@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* モダンカラーパレット */
:root {
    /* グレースケール */
    --white: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    --black: #000000;
    
    /* アクセントカラー */
    --primary: #18181b;
    --primary-light: #27272a;
    --primary-lighter: #3f3f46;
    
    /* システムカラー */
    --success: #16a34a;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    /* シャドウ */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* トランジション */
    --transition-all: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-colors: color 0.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* リセット */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ベーススタイル */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--white);
    color: var(--gray-900);
    line-height: 1.6;
    font-feature-settings: 'cv11', 'ss01';
    font-variation-settings: 'opsz' 32;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* コンテナ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    flex-grow: 1;
}

/* ナビゲーション */
.navbar {
    background-color: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    min-height: 90px;
    display: flex;
    align-items: center;
}

.navbar .container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--primary) !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-colors);
}

.navbar-brand:hover {
    color: var(--primary-light) !important;
}

.navbar-nav .nav-link {
    color: var(--gray-600) !important;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: var(--transition-colors);
}

.navbar-nav .nav-link:hover {
    color: var(--primary) !important;
    background-color: var(--gray-50);
}

/* ナビゲーションメニューの位置調整 */
.navbar-nav {
    z-index: 1001;
}

/* カード */
.card {
    background-color: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-all);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--gray-300);
}

.card-body {
    padding: 2rem;
}

.card-title {
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
}

.card-text {
    color: var(--gray-600);
    font-size: 0.875rem;
    line-height: 1.7;
}

/* ボタン */
.btn {
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: var(--transition-all);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    line-height: 1;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--primary-light);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
    background-color: var(--primary) !important;
    color: var(--white) !important;
}

.btn-secondary {
    background-color: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

.btn-secondary:hover {
    background-color: var(--gray-200);
    color: var(--gray-800);
    border-color: var(--gray-300);
}

.btn-danger {
    background-color: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background-color: #dc2626;
    color: var(--white);
}

.w-100 {
    width: 100%;
}

/* フォーム */
.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    display: block;
}

.form-control, .form-select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    background-color: var(--white);
    color: var(--gray-900);
    font-size: 0.875rem;
    transition: var(--transition-colors);
    width: 100%;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgb(24 24 27 / 0.1);
}

.form-control::placeholder {
    color: var(--gray-400);
}

.mb-3 {
    margin-bottom: 1.5rem;
}

/* アラート */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.alert-warning {
    background-color: #fffbeb;
    color: #92400e;
    border-color: #fed7aa;
}

.alert-info {
    background-color: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

/* テーブル */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    font-size: 0.875rem;
}

.table thead th {
    background-color: var(--gray-50);
    color: var(--gray-700);
    font-weight: 600;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-900);
}

.table tbody tr {
    transition: var(--transition-colors);
}

.table tbody tr:hover {
    background-color: var(--gray-50);
}

.table-striped tbody tr:nth-child(even) {
    background-color: var(--gray-50);
}

.table-striped tbody tr:nth-child(even):hover {
    background-color: var(--gray-100);
}

/* タイポグラフィ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--primary);
    letter-spacing: -0.025em;
    line-height: 1.2;
}

h1 {
    font-size: 2.25rem;
    margin-bottom: 2rem;
}

h2 {
    font-size: 1.875rem;
    margin-bottom: 1.5rem;
    margin-top: 3rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

h4 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}

h5 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

h6 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

/* ユーティリティ */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--gray-500) !important;
}

.mt-5 {
    margin-top: 3rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.min-vh-100 {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 0;
}

/* レイアウト */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 0.75rem;
}

.col-md-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 0.75rem;
}

.offset-md-3 {
    margin-left: 25%;
}

.justify-content-center {
    justify-content: center;
}

/* フッター */
footer {
    background-color: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    padding: 2rem 0;
    margin-top: auto;
    text-align: center;
    color: var(--gray-600);
    font-size: 0.875rem;
}

/* フッター内のリンクを黒色に */
footer a {
    color: var(--black);
    text-decoration: underline;
}

footer a:hover {
    color: var(--gray-700);
}

/* レスポンシブ */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 2rem;
    }
    
    .offset-md-3 {
        margin-left: 0;
    }
    
    h1 {
        font-size: 1.875rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .table {
        font-size: 0.75rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.5rem;
    }
    
        .navbar-brand {
        font-size: 1.25rem;
        position: static;
        transform: none;
    }

    .navbar-brand img {
        height: 50px !important;
    }

    .navbar .container {
        justify-content: center;
    }
}

/* ダークモード対応準備 */
@media (prefers-color-scheme: dark) {
    /* 将来的にダークモード実装時に使用 */
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.3s ease-out;
}

/* フォーカス表示改善 */
*:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn-primary:focus {
    background-color: var(--primary) !important;
    color: var(--white) !important;
    border-color: var(--primary) !important;
}

/* ローディング状態 */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* 追加のマイクロインタラクション */
.navbar {
    transition: var(--transition-all);
}

.table tbody tr {
    cursor: pointer;
}

/* 特別なスタイリング: ロゴエリア */
.navbar-brand img {
    transition: var(--transition-all);
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

/* メインコンテンツエリア */
main {
    flex-grow: 1;
    padding: 2rem 0;
}

/* カスタムスクロールバー（Webkit ブラウザ） */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ローディングアニメーション用のCSS */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.btn-loading {
    opacity: 0.8;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* フォームバリデーション */
.is-valid {
    border-color: var(--success) !important;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1) !important;
}

.is-invalid {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* 認証エラー時のアニメーション */
.alert-danger {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 成功時のアニメーション */
.alert-success {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* プログレスバー */
.progress-container {
    width: 100%;
    height: 8px;
    background-color: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 1rem;
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left;
    transition: all 0.3s ease;
}

.progress-container.show {
    opacity: 1;
    transform: scaleX(1);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--success) 0%, #22c55e 50%, var(--success) 100%);
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ボタンホバー時の追加効果 */
.btn-primary:hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 49%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.1) 51%, transparent 52%);
    animation: shine 0.6s ease-out;
    pointer-events: none;
}

@keyframes shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Stripe風 送信ボタンアニメーション */
.btn-submit-animation {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 120px;
    overflow: hidden;
    position: relative;
}

.btn-submit-animation.loading {
    pointer-events: none;
    background-color: var(--primary-light) !important;
    color: var(--white) !important;
}

.btn-submit-animation.loading:active,
.btn-submit-animation.loading:focus,
.btn-submit-animation.loading:hover {
    background-color: var(--primary-light) !important;
    color: var(--white) !important;
    box-shadow: none !important;
    transform: none !important;
    opacity: 1 !important;
}

.btn-submit-animation.expanding {
    transform: scale(1.02);
    z-index: 9999;
    color: var(--white) !important;
}

.btn-submit-animation.expanding:active,
.btn-submit-animation.expanding:focus,
.btn-submit-animation.expanding:hover {
    color: var(--white) !important;
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    box-shadow: none !important;
    transform: scale(1.02) !important;
    opacity: 1 !important;
}

/* ボタン内波紋拡散エフェクト */
.btn-submit-animation::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background-color: var(--success);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 0;
    opacity: 0;
}

.btn-submit-animation.success::before {
    width: 300%;
    height: 300%;
    opacity: 1;
}

/* ローディング中は円形エフェクトを隠す */
.btn-submit-animation.loading::before {
    width: 0;
    height: 0;
    opacity: 0;
}

/* ボタンテキストを波紋の上に表示 */
.btn-submit-animation.success {
    pointer-events: none;
    position: relative;
    color: white !important;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    background-color: var(--success) !important;
    border-color: var(--success) !important;
}

/* 成功状態では:activeエフェクトを完全に無効化 */
.btn-submit-animation.success:active,
.btn-submit-animation.success:focus,
.btn-submit-animation.success:hover {
    background-color: var(--success) !important;
    color: white !important;
    border-color: var(--success) !important;
    box-shadow: none !important;
    transform: none !important;
    opacity: 1 !important;
}

.btn-submit-animation.success > * {
    position: relative;
    z-index: 2;
    color: white !important;
}

/* SVGチェックマークも確実に白色に */
.btn-submit-animation.success .checkmark {
    color: white !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* ローディングスピナー（改良版） */
.loading-spinner-stripe {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin-smooth 0.8s linear infinite;
}

@keyframes spin-smooth {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* チェックマークアニメーション */
.checkmark {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    stroke: white;
    stroke-width: 2.5;
    stroke-miterlimit: 10;
    animation: checkmark-scale 0.3s ease-in-out;
}

.checkmark path {
    stroke-dasharray: 16;
    stroke-dashoffset: 16;
    animation: checkmark-draw 0.3s ease-in-out 0.1s forwards;
}

@keyframes checkmark-scale {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes checkmark-draw {
    to { stroke-dashoffset: 0; }
}

/* ボタン内波紋エフェクト（::beforeで実装済み） */

/* ページ遷移エフェクト */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
}

.page-transition.active {
    opacity: 1;
    pointer-events: all;
}

/* 画面全体オーバーレイは削除済み（ボタン内波紋に集中） */
