/* ============================================
   rtpay 退職金確認システム - 共通スタイル
   モダンデザイン（ライトテーマ + グラスモーフィズム）
   ============================================ */

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

/* CSS変数（テーマカラー） */
:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.15);
    --accent: #06b6d4;
    --accent-hover: #0891b2;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    --bg-dark: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-hover: rgba(255, 255, 255, 1);
    --bg-input: rgba(241, 245, 249, 0.8);
    --bg-table-row: rgba(241, 245, 249, 0.5);
    --bg-table-row-hover: rgba(99, 102, 241, 0.06);

    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --border: rgba(226, 232, 240, 0.8);
    --border-hover: rgba(99, 102, 241, 0.4);

    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.08);

    --radius: 16px;
    --radius-sm: 8px;
    --radius-lg: 24px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* リセットと基本スタイル */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* 背景アニメーション */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(6, 182, 212, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(16, 185, 129, 0.03) 0%, transparent 50%);
    z-index: -1;
    animation: bgShift 20s ease-in-out infinite alternate;
}

@keyframes bgShift {
    0% {
        opacity: 0.8;
    }

    100% {
        opacity: 1;
    }
}

/* ============================================
   ログインページ
   ============================================ */

.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow), var(--shadow-glow);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card__icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 28px;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.login-card__title {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #64748b;
    letter-spacing: 0.08em;
}

.login-card__subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 36px;
}

/* エラーメッセージ */
.login-card__error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 24px;
    color: #dc2626;
    font-size: 0.875rem;
    text-align: center;
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes shake {

    10%,
    90% {
        transform: translateX(-1px);
    }

    20%,
    80% {
        transform: translateX(2px);
    }

    30%,
    50%,
    70% {
        transform: translateX(-4px);
    }

    40%,
    60% {
        transform: translateX(4px);
    }
}

/* フォーム要素 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* ボタン */
.btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* ============================================
   ダッシュボード
   ============================================ */

.dashboard {
    max-width: 1300px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ヘッダー */
.dashboard__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.dashboard__user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dashboard__avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.dashboard__user-name {
    font-size: 1.25rem;
    font-weight: 600;
}

.dashboard__user-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.btn-logout {
    padding: 10px 20px;
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

/* 情報カード */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.info-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.info-card__label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.info-card__value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.info-card__note {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.5;
}

.info-card--total {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.1));
    border-color: rgba(99, 102, 241, 0.2);
}

.info-card--total .info-card__value {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.info-card__icon {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

/* セクションカード */
.section-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 24px;
}

.section-card__title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-card__title-icon {
    font-size: 1.25rem;
}

/* グラフコンテナ */
.chart-wrapper {
    position: relative;
    width: 100%;
    height: 400px;
    margin: 0 auto;
}

/* 注意事項 */
.notes-list {
    list-style: none;
    padding: 0;
    margin-top: 16px;
}

.notes-list li {
    padding: 8px 12px;
    font-size: 0.8125rem;
    color: var(--warning);
    background: rgba(245, 158, 11, 0.08);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.notes-list li::before {
    content: '⚠';
    flex-shrink: 0;
}

/* ============================================
   履歴テーブル
   ============================================ */

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-sm);
}

.history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
}

.history-table thead th {
    background: rgba(241, 245, 249, 0.9);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 14px 16px;
    text-align: right;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1;
}

.history-table thead th:first-child {
    text-align: left;
    border-radius: var(--radius-sm) 0 0 0;
}

.history-table thead th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

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

.history-table tbody tr:hover {
    background: var(--bg-table-row-hover);
}

.history-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    text-align: right;
    color: var(--text-primary);
}

.history-table tbody td:first-child {
    text-align: left;
    color: var(--text-secondary);
    font-weight: 500;
}

.history-table tbody tr:nth-child(even) {
    background: var(--bg-table-row);
}

.history-table tbody tr:nth-child(even):hover {
    background: var(--bg-table-row-hover);
}

/* ============================================
   レスポンシブ
   ============================================ */

@media (max-width: 768px) {
    .login-card {
        padding: 36px 24px;
        margin: 16px;
    }

    .dashboard {
        padding: 20px 16px;
    }

    .dashboard__header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .dashboard__user-info {
        flex-direction: column;
    }

    .info-cards {
        grid-template-columns: 1fr 1fr;
    }

    .info-card__value {
        font-size: 1.25rem;
    }

    .info-card--total .info-card__value {
        font-size: 1.5rem;
    }

    .chart-wrapper {
        height: 300px;
    }

    .section-card {
        padding: 20px 16px;
    }

    .history-table {
        font-size: 0.8125rem;
    }

    .history-table thead th,
    .history-table tbody td {
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .info-cards {
        grid-template-columns: 1fr;
    }
}