/* ===========================================
   SecureAuthSystem — Official Stylesheet
   Clean, minimal, professional dark theme
   =========================================== */

/* ---------- CSS Variables (Design Tokens) ---------- */
:root {
    --bg-primary: #0f1115;
    --bg-secondary: #181b21;
    --bg-card: #1e2127;
    --bg-hover: #25282e;
    --border-subtle: #2a2d35;
    --border-focus: #3b82f6;
    --text-primary: #e2e4e9;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.5);
    --transition: 0.15s ease;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    line-height: 1.5;
}

/* ---------- Page Structure ---------- */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 60px);
}

.main-content {
    flex: 1;
    padding-top: 2rem;
    padding-bottom: 3rem;
}

/* ---------- Navbar ---------- */
#mainNavbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0;
}

.brand-icon {
    font-size: 1.25rem;
    margin-right: 0.5rem;
    color: var(--accent);
}

.brand-text {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}
#mainNavbar {
    padding-block: 10px;
}
#mainNavbar .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem;
    border-radius: 0;
    transition: color var(--transition), background var(--transition);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

    #mainNavbar .nav-link:hover,
    #mainNavbar .nav-link:focus {
        color: var(--text-primary) !important;
        background: var(--bg-hover);
    }

    #mainNavbar .nav-link.active {
        color: var(--accent) !important;
        border-bottom-color: var(--accent);
        background: transparent;
    }

.nav-icon {
    font-size: 0.9rem;
}

.user-greeting {
    color: var(--accent) !important;
    font-weight: 500;
    cursor: default;
}

.btn-link-nav {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-family);
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    transition: color var(--transition);
}

    .btn-link-nav:hover {
        color: var(--text-primary);
    }

/* ---------- Cards / Panels ---------- */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition);
}

    .glass-card:hover {
        border-color: #3a3d47;
    }

.glass-card-sm {
    max-width: 440px;
    margin: 0 auto;
}

.glass-card-md {
    max-width: 600px;
    margin: 0 auto;
}

/* ---------- Page Titles ---------- */
.page-title {
    font-size: 1.75rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.page-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* ---------- Form Controls ---------- */
.form-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
    display: block;
}

.form-control {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 0.65rem 0.875rem;
    font-size: 0.9rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    width: 100%;
}

    .form-control:focus {
        border-color: var(--border-focus);
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
        outline: none;
    }

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

/* Validation errors */
.text-danger,
.field-validation-error {
    color: var(--danger) !important;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.validation-summary-errors ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .validation-summary-errors ul li {
        background: rgba(239, 68, 68, 0.08);
        border: 1px solid rgba(239, 68, 68, 0.15);
        border-radius: var(--radius-sm);
        padding: 0.5rem 0.875rem;
        margin-bottom: 0.5rem;
        color: #fca5a5;
        font-size: 0.85rem;
    }

/* ---------- Buttons ---------- */
.btn-primary-custom {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.65rem 1.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    text-decoration: none;
}

    .btn-primary-custom:hover {
        background: var(--accent-hover);
        color: #fff;
    }

    .btn-primary-custom:active {
        background: #1d4ed8;
    }

.btn-secondary-custom {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.25rem;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

    .btn-secondary-custom:hover {
        background: var(--bg-hover);
        color: var(--text-primary);
        border-color: #3a3d47;
    }

.btn-danger-custom {
    background: rgba(239, 68, 68, 0.08);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: var(--radius-sm);
    padding: 0.4rem 1rem;
    font-weight: 500;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
}

    .btn-danger-custom:hover {
        background: rgba(239, 68, 68, 0.15);
        color: #fee2e2;
        border-color: rgba(239, 68, 68, 0.3);
    }

.btn-success-custom {
    background: rgba(16, 185, 129, 0.08);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: var(--radius-sm);
    padding: 0.4rem 1rem;
    font-weight: 500;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

    .btn-success-custom:hover {
        background: rgba(16, 185, 129, 0.15);
        color: #a7f3d0;
        border-color: rgba(16, 185, 129, 0.3);
    }

/* ---------- Alerts ---------- */
.alert-custom {
    border-radius: var(--radius-md);
    border: 1px solid;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.06) !important;
    color: #6ee7b7 !important;
    border-color: rgba(16, 185, 129, 0.15) !important;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.06) !important;
    color: #fca5a5 !important;
    border-color: rgba(239, 68, 68, 0.15) !important;
}

.alert-icon {
    font-size: 1rem;
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.5;
    transition: opacity var(--transition);
}

    .btn-close:hover {
        opacity: 1;
    }

/* ---------- Tables ---------- */
.table-custom {
    width: 100%;
    border-collapse: collapse;
}

    .table-custom thead th {
        background: var(--bg-secondary);
        color: var(--text-secondary);
        font-weight: 600;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--border-subtle);
        text-align: left;
    }

    .table-custom tbody td {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--border-subtle);
        color: var(--text-secondary);
        font-size: 0.875rem;
        vertical-align: middle;
    }

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

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

/* ---------- CAPTCHA ---------- */
.captcha-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
}

    .captcha-container img {
        border-radius: var(--radius-sm);
        margin-bottom: 0.75rem;
        border: 1px solid var(--border-subtle);
    }

/* ---------- Home / Hero Section ---------- */
.hero-section {
    text-align: center;
    padding: 3rem 0 2.5rem;
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

    .hero-title .gradient-text {
        color: var(--accent);
    }

.hero-description {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

    .hero-actions .btn-primary-custom {
        width: auto;
        padding: 0.65rem 1.75rem;
        font-size: 0.9rem;
    }

    .hero-actions .btn-secondary-custom {
        padding: 0.6rem 1.75rem;
        font-size: 0.9rem;
    }

/* Feature cards grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 2.5rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: border-color var(--transition);
}

    .feature-card:hover {
        border-color: #3a3d47;
    }

.feature-icon {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    display: block;
    color: var(--accent);
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

/* ---------- Dashboard ---------- */
.dashboard-header {
    text-align: center;
    margin-bottom: 2rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: border-color var(--transition);
    text-decoration: none;
    display: block;
}

    .dashboard-card:hover {
        border-color: var(--accent);
    }

    .dashboard-card .card-icon {
        font-size: 1.75rem;
        margin-bottom: 0.6rem;
        display: block;
        color: var(--accent);
    }

    .dashboard-card h3 {
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 0.3rem;
    }

    .dashboard-card p {
        font-size: 0.8rem;
        color: var(--text-muted);
        margin: 0;
    }

/* ---------- Decrypt result ---------- */
.result-block {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
}

    .result-block .label {
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--text-muted);
        margin-bottom: 0.25rem;
    }

    .result-block .value {
        font-size: 0.875rem;
        color: var(--text-primary);
        word-break: break-all;
        font-family: 'Consolas', 'Courier New', monospace;
    }

        .result-block .value.decrypted {
            color: var(--success);
            font-family: var(--font-family);
            font-size: 1rem;
            font-weight: 500;
        }

/* ---------- Form Links ---------- */
.form-links {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

    .form-links a {
        color: var(--accent);
        text-decoration: none;
        font-weight: 500;
        transition: color var(--transition);
    }

        .form-links a:hover {
            color: var(--accent-hover);
            text-decoration: underline;
        }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    padding: 1rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ---------- Animations ---------- */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

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

.animate-in {
    animation: fadeInUp 0.3s ease forwards;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

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

    ::-webkit-scrollbar-thumb:hover {
        background: #3a3d47;
    }

/* ---------- Selection ---------- */
::selection {
    background: rgba(59, 130, 246, 0.25);
    color: var(--text-primary);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .hero-title {
        font-size: 1.75rem;
    }

    .hero-description {
        font-size: 0.9rem;
    }

    .glass-card {
        padding: 1.25rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }
}

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

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

        .hero-actions .btn-primary-custom,
        .hero-actions .btn-secondary-custom {
            width: 100%;
        }
}
