/* ================================================================
   AMLO VPN Portal – Premium Design System
   ================================================================ */

:root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.35);
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --success: #10b981;
    --success-bg: #ecfdf5;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --warning: #f59e0b;

    --text-main: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;

    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-bg-light: rgba(255, 255, 255, 0.45);
    --glass-border: rgba(255, 255, 255, 0.55);
    --glass-border-inner: rgba(255, 255, 255, 0.8);
    --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.4);
    --shadow-btn: 0 4px 14px 0 rgba(59, 130, 246, 0.35);
    --radius-card: 28px;
    --radius-inner: 16px;
    --radius-btn: 12px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Font Stack ─────────────────────────────────────────── */
@font-face {
    font-family: 'Sarabun';
    font-style: normal;
    font-weight: 400;
    src: url('../fonts/Sarabun-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Sarabun';
    font-style: normal;
    font-weight: 500;
    src: url('../fonts/Sarabun-Medium.ttf') format('truetype');
}

@font-face {
    font-family: 'Sarabun';
    font-style: normal;
    font-weight: 700;
    src: url('../fonts/Sarabun-Bold.ttf') format('truetype');
}

/* ── Base ────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Sarabun', 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    color: var(--text-main);
    background: #eef2ff;
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* ── Animated Mesh Background ────────────────────────────── */
.background-blobs {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.background-blobs::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(99, 102, 241, 0.18) 0%, transparent 60%),
        radial-gradient(ellipse 70% 70% at 80% 80%, rgba(59, 130, 246, 0.16) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 60% 20%, rgba(16, 185, 129, 0.10) 0%, transparent 60%);
}

.blob {
    position: absolute;
    border-radius: 50%;
    -webkit-filter: blur(70px);
    filter: blur(70px);
    -webkit-animation: float-blob 22s infinite alternate ease-in-out;
    animation: float-blob 22s infinite alternate ease-in-out;
    will-change: transform;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25), rgba(59, 130, 246, 0.12));
    top: -150px;
    left: -150px;
}

.blob-2 {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2), rgba(59, 130, 246, 0.10));
    bottom: -80px;
    right: -80px;
    -webkit-animation-delay: -7s;
    animation-delay: -7s;
}

.blob-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.14), rgba(239, 68, 68, 0.08));
    top: 45%;
    left: 65%;
    -webkit-animation-delay: -14s;
    animation-delay: -14s;
}

@-webkit-keyframes float-blob {
    0% {
        -webkit-transform: translate(0, 0) scale(1);
        transform: translate(0, 0) scale(1);
    }

    50% {
        -webkit-transform: translate(30px, 60px) scale(1.08);
        transform: translate(30px, 60px) scale(1.08);
    }

    100% {
        -webkit-transform: translate(-20px, 30px) scale(0.95);
        transform: translate(-20px, 30px) scale(0.95);
    }
}

@keyframes float-blob {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(30px, 60px) scale(1.08);
    }

    100% {
        transform: translate(-20px, 30px) scale(0.95);
    }
}

/* ── Glass Card ──────────────────────────────────────────── */
.glass-container {
    position: relative;
    z-index: 10;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    animation: slide-up 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(32px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Login Card ──────────────────────────────────────────── */
.login-card {
    width: 90%;
    max-width: 440px;
    padding: 3rem 2.5rem 2.75rem;
    text-align: center;
    margin: 20px;
}

.logo {
    width: 130px;
    height: auto;
    margin-bottom: 1.75rem;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.08));
    transition: transform var(--transition);
}

.logo:hover {
    transform: scale(1.04);
}

.login-card h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 0.6rem;
    background: linear-gradient(135deg, #1e293b 0%, #4338ca 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.login-card .subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.65;
    margin: 0 0 2rem;
}

.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* ── ThaID Button ────────────────────────────────────────── */
.btn-thaid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #2b3990 0%, #1a237e 100%);
    color: white;
    border: none;
    border-radius: var(--radius-btn);
    font-size: 1.05rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    box-shadow: 0 4px 16px rgba(43, 57, 144, 0.35);
    position: relative;
    overflow: hidden;
}

.btn-thaid::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, transparent 50%);
    pointer-events: none;
}

.btn-thaid:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(43, 57, 144, 0.45);
}

.btn-thaid:active {
    transform: translateY(0);
}

/* ── Primary & Outline Buttons ───────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    padding: 0.8rem 1.75rem;
    border-radius: var(--radius-btn);
    font-weight: 700;
    font-size: 0.95rem;
    font-family: inherit;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-btn);
    white-space: nowrap;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px var(--primary-glow);
    filter: brightness(1.05);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-set-password {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn-set-password:hover {
    box-shadow: 0 8px 22px rgba(79, 70, 229, 0.45);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: rgba(239, 68, 68, 0.06);
    color: var(--danger);
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-btn);
    font-weight: 600;
    font-size: 0.95rem;
    font-family: inherit;
    text-decoration: none;
    border: 1px solid rgba(239, 68, 68, 0.25);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-outline:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
}

/* ── Instruction Container ───────────────────────────────── */
.instruction-container {
    width: 95%;
    max-width: 1100px;
    padding: 2.5rem;
    margin: 24px auto;
}

/* ── Header ──────────────────────────────────────────────── */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 22px;
    margin-bottom: 1rem;
    position: relative;
}

.icon-badge.success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.25);
}

.icon-badge.primary {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
}

.icon-badge.warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.22);
}

.header h1 {
    font-size: 2.1rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #0f172a 0%, #1e40af 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin: 0.5rem 0 0;
    line-height: 1.6;
}

/* Success Icon (legacy, keep for compatibility) */
.success-icon-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.success-icon {
    width: 64px;
    height: 64px;
    filter: drop-shadow(0 4px 8px rgba(16, 185, 129, 0.25));
}

/* ── User Info Card ──────────────────────────────────────── */
.user-info-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.4));
    border: 1px solid var(--glass-border-inner);
    border-radius: var(--radius-inner);
    padding: 1.2rem 1.75rem;
    margin-bottom: 1.75rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.user-badge {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    width: 100%;
}

.badge-col {
    flex: 1;
    min-width: 180px;
}

.badge-label {
    text-transform: uppercase;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.07em;
    display: block;
    margin-bottom: 0.3rem;
}

.badge-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
}

/* ── Status Badges ───────────────────────────────────────── */
.status-success {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #065f46;
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    padding: 0.3rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.status-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #991b1b;
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    padding: 0.3rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

/* ── Instruction Grid ────────────────────────────────────── */
.instruction-main {
    margin-bottom: 0;
}

.instruction-grid {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
}

@media (max-width: 900px) {
    .instruction-grid {
        grid-template-columns: 1fr;
    }
}

.section-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-secondary);
}

.section-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 1.4rem;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── Steps ───────────────────────────────────────────────── */
.fancy-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.step-item {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.9);
    padding: 0.7rem 1.2rem;
    border-radius: var(--radius-inner);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all var(--transition);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.step-item:hover {
    transform: translateX(6px);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.12);
    background: rgba(255, 255, 255, 0.9);
}

.step-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: 0.95rem;
    flex-shrink: 0;
    box-shadow: 0 4px 8px var(--primary-glow);
}

.step-text {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.step-text strong {
    color: var(--primary);
}

/* ── Visual Section ─────────────────────────────────────── */
.visual-section {
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-wrapper {
    position: relative;
    border-radius: var(--radius-inner);
    overflow: hidden;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.2);
    transition: transform var(--transition);
}

.image-wrapper:hover {
    transform: translateY(-4px);
}

.mockup-img {
    width: 100%;
    display: block;
}

.image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(30, 41, 59, 0.08) 100%);
    pointer-events: none;
}

/* ── Action Footer ───────────────────────────────────────── */
.action-footer {
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    padding-top: 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.button-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

/* ── Expiry Timer ────────────────────────────────────────── */
.expiry-timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fffbeb;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: 1px solid #fde68a;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.12);
}

.timer-label {
    font-size: 0.85rem;
    color: #92400e;
}

.timer-value {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--danger);
}

/* ── Alert Notifications ─────────────────────────────────── */
.alert-box {
    padding: 0.85rem 1.2rem;
    border-radius: 10px;
    font-size: 0.93rem;
    font-weight: 500;
    line-height: 1.55;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.alert-box.success {
    background: #f0fdf4;
    color: #065f46;
    border: 1px solid #bbf7d0;
}

.alert-box.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ── Password Reset Form ─────────────────────────────────── */
.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.85);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper .form-control {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    padding: 0.5rem;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition), transform var(--transition);
    border-radius: 8px;
    z-index: 5;
}

.password-toggle:hover {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.08);
}

.password-toggle:active {
    transform: scale(0.92);
}

.password-toggle svg {
    pointer-events: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
    background: white;
}

.form-control::placeholder {
    color: #94a3b8;
}

/* ── Password Rules ──────────────────────────────────────── */
.complexity-rules {
    background: rgba(248, 250, 252, 0.85);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-inner);
    padding: 1.5rem;
    margin-top: 0.5rem;
    text-align: left;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem 1.5rem;
}

.complexity-rules strong {
    grid-column: span 2;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: block;
    margin-bottom: 0.4rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 0.25rem 0;
    transition: color 0.2s;
}

.rule-item.valid {
    color: var(--success);
}

.rule-icon {
    font-size: 0.7rem;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
    transition: transform 0.2s;
}

.rule-item.valid .rule-icon {
    transform: scale(1.2);
}

/* ── Error / Not-Found Card ──────────────────────────────── */
.error-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 3.5rem 2.5rem;
    text-align: center;
    max-width: 500px;
    width: 90%;
    margin: 20px;
    animation: slide-up 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
    position: relative;
    z-index: 10;
}

.error-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 24px;
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.22);
}

.error-card h1 {
    font-size: 1.7rem;
    font-weight: 800;
    margin: 0 0 0.75rem;
    color: var(--text-main);
}

.error-card p {
    color: var(--text-muted);
    line-height: 1.65;
    margin: 0 0 1rem;
    font-size: 1rem;
}

.contact-info {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    margin-top: 1.25rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(99, 102, 241, 0.08));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-inner);
    padding: 1rem 2rem;
    font-size: 1rem;
    color: var(--text-secondary);
}

.contact-info strong {
    font-size: 1.25rem;
    color: var(--primary);
}

/* ── Skeleton Loader ─────────────────────────────────────── */
.skeleton-loader {
    height: 52px;
    background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
    background-size: 200% 100%;
    animation: shimmer 1.6s infinite;
    border-radius: 12px;
}

@keyframes shimmer {
    to {
        background-position-x: -200%;
    }
}

/* ── Spinner ─────────────────────────────────────────────── */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
    .instruction-container {
        padding: 1.5rem;
    }

    .glass-container {
        border-radius: 20px;
    }

    .action-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .button-row {
        flex-direction: column;
    }

    .btn-primary,
    .btn-outline,
    .btn-set-password {
        width: 100%;
        justify-content: center;
    }

    .header h1 {
        font-size: 1.6rem;
    }

    .complexity-rules {
        grid-template-columns: 1fr;
        padding: 1.25rem;
    }
}

/* ── Utility classes extracted from inline styles (CSP compliance) ───── */

/* index.html – hint text below ThaID button */
.login-hint {
    margin: 1.5rem 0 0;
    font-size: 0.82rem;
    color: #94a3b8;
}

/* not_registered.html – action footer wrapper */
.action-footer-wrap {
    margin-top: 2rem;
}

/* not_registered.html – centred btn-primary link */
.btn-center {
    text-decoration: none;
    justify-content: center;
    width: 100%;
}

/* instruction.html – initially-hidden step item */
.step-hidden {
    display: none;
}

/* instruction.html – alert container for password-reset feedback */
.reset-alert-wrap {
    width: 100%;
    margin-bottom: 0.5rem;
    display: none;
}

/* reset_password.html – compact header (no bottom margin) */
.header-compact {
    margin-bottom: 0;
}

/* reset_password.html – moved out of <style> block */
.reset-wrapper {
    width: 95%;
    max-width: 580px;
    padding: 3rem 3.5rem;
    margin: 40px auto;
    text-align: center;
}

#resetForm {
    text-align: left;
    margin-top: 1.75rem;
}

#alertMessage {
    margin-bottom: 1rem;
    display: none;
}

.btn-block {
    width: 100%;
    justify-content: center;
    margin-top: 1.5rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1.25rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--primary);
}

.btn-loading {
    pointer-events: none;
    opacity: 0.75;
}

/* ── Fullscreen Error Modal ───────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-card {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    padding: 2.25rem 2rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(226, 232, 240, 0.8);
    transform: scale(0.92);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-close-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close-icon:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: rotate(90deg);
}

.modal-icon-badge {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-icon-badge.error {
    background: #fef2f2;
    border: 2px solid #fee2e2;
}

.modal-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.75rem;
}

.modal-message {
    font-size: 1rem;
    line-height: 1.6;
    color: #475569;
    margin: 0 0 1.75rem;
    word-break: break-word;
}

.modal-actions {
    display: flex;
    justify-content: center;
}

.btn-modal-close {
    background: #ef4444;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 0.75rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    transition: all 0.2s ease;
    width: 100%;
}

.btn-modal-close:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.btn-modal-close:active {
    transform: translateY(0);
}