﻿
:root {
    --auth-primary: #0d6efd;
    --auth-primary-hover: #0b5ed7;
    --auth-primary-shadow: rgba(13, 110, 253, 0.12);
    --auth-primary-shadow-strong: rgba(13, 110, 253, 0.3);
    --auth-primary-focus-ring: rgba(59, 130, 246, 0.15);
    --auth-focus-border: #3b82f6;
    --auth-border: #cbd5e1;
    --auth-radius-card: 16px;
    --auth-radius-input: 12px;
    --auth-text-heading: #111827;
    --auth-text-label: #374151;
    --auth-text-muted: #6b7280;
}

html, body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

    body.sidebar-collapsed #main-content {
        margin-left: 0 !important;
    }

.auth-page-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(24px, 8vh, 90px) 16px 40px;
    box-sizing: border-box;
}

.auth-card {
    background: #ffffff;
    border: 1px solid rgba(13, 110, 253, 0.25);
    border-radius: var(--auth-radius-card);
    box-shadow: 0 8px 24px var(--auth-primary-shadow);
    padding: 1.75rem;
    width: 100%;
    max-width: 24rem;
    box-sizing: border-box;
    flex-shrink: 0;
}

.auth-card--wide {
    max-width: 56rem;
    padding: 2rem;
}

.auth-validation-summary {
    width: 100%;
    max-width: 56rem;
    box-sizing: border-box;
}

.auth-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--auth-text-heading);
    text-align: center;
    margin: 0;
}

.auth-title--lg {
    font-size: 1.75rem;
    margin-bottom: 2rem;
}

.auth-subtitle {
    font-size: 0.85rem;
    color: var(--auth-text-muted);
    text-align: center;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.45;
}

    .auth-subtitle strong {
        color: var(--auth-primary);
        font-weight: 700;
    }

.auth-message {
    width: 100%;
    max-width: 24rem;
    box-sizing: border-box;
    border-radius: var(--auth-radius-input);
    padding: 0.9rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    line-height: 1.4;
}

.auth-message--wide {
    max-width: 56rem;
}

.auth-message--success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.auth-message--error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.auth-label {
    display: block;
    color: var(--auth-text-label);
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 0.25rem;
    margin-bottom: 0.35rem;
}

.auth-input {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: var(--auth-radius-input);
    border: 1px solid var(--auth-border);
    font-size: 1rem;
    box-sizing: border-box;
    background-color: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

    .auth-input:focus {
        outline: none;
        border-color: var(--auth-focus-border);
        box-shadow: 0 0 0 3px var(--auth-primary-focus-ring);
    }

.auth-input--error {
    border-color: #ef4444 !important;
}

    .auth-input--error:focus {
        border-color: #ef4444 !important;
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
    }

.auth-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.25rem;
}

    .auth-field:last-of-type {
        margin-bottom: 0;
    }

.auth-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 1.5rem;
}

@media (min-width: 768px) {
    .auth-form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.auth-form-grid-full {
    grid-column: 1 / -1;
}

.auth-input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.auth-input-prefix {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    border: 1px solid var(--auth-border);
    border-right: none;
    border-radius: var(--auth-radius-input) 0 0 var(--auth-radius-input);
    background-color: #f3f4f6;
    color: #4b5563;
    font-weight: 600;
    white-space: nowrap;
}

.auth-input-group .auth-input {
    border-radius: 0 var(--auth-radius-input) var(--auth-radius-input) 0;
}

.auth-verify-btn {
    align-self: flex-start;
    margin-top: 0.6rem;
    border: none;
    border-radius: 999px;
    background-color: var(--auth-primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0.45rem 1.1rem;
    box-shadow: 0 4px 10px var(--auth-primary-shadow-strong);
    transition: background-color .15s ease, transform .1s ease;
}

    .auth-verify-btn:hover:not(:disabled) {
        background-color: var(--auth-primary-hover);
    }

    .auth-verify-btn:active:not(:disabled) {
        transform: scale(0.97);
    }

    .auth-verify-btn:disabled {
        opacity: 0.45;
        cursor: not-allowed;
        box-shadow: none;
    }

.auth-code-row {
    display: flex;
    align-items: stretch;
    margin-top: 0.6rem;
}

.auth-code-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    flex-shrink: 0;
    border: 1px solid var(--auth-border);
    border-right: none;
    border-radius: var(--auth-radius-input) 0 0 var(--auth-radius-input);
    background-color: #eef2ff;
    color: var(--auth-primary);
    font-weight: 700;
}

.auth-code-input {
    border-radius: 0 var(--auth-radius-input) var(--auth-radius-input) 0;
}

.auth-code-actions {
    margin-top: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-code-status {
    font-weight: 600;
    font-size: 0.85rem;
}

.auth-code-status--success {
    color: #16a34a;
}

.auth-code-status--error {
    color: #dc2626;
}

.auth-subcard {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.auth-dropzone {
    border: 1.5px dashed #d1d5db;
    border-radius: 14px;
    background: #fafafa;
    text-align: center;
    color: #6b7280;
    padding: 1.5rem 1rem;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}

    .auth-dropzone:hover,
    .auth-dropzone.is-dragover {
        border-color: var(--auth-focus-border);
        background-color: #eff6ff;
    }

.auth-submit-btn {
    width: 100%;
    border: none;
    border-radius: var(--auth-radius-input);
    background-color: var(--auth-primary);
    color: #ffffff;
    font-weight: 700;
    padding: 0.9rem;
    font-size: 1rem;
    box-shadow: 0 4px 12px var(--auth-primary-shadow-strong);
    transition: transform 0.1s ease, background-color 0.15s ease;
    margin-top: 0.5rem;
}

    .auth-submit-btn:hover:not(:disabled) {
        background-color: var(--auth-primary-hover);
    }

    .auth-submit-btn:active:not(:disabled) {
        transform: scale(0.98);
    }

    .auth-submit-btn:disabled {
        background-color: #d1d5db;
        color: #6b7280;
        box-shadow: none;
        cursor: not-allowed;
    }

.auth-link {
    display: block;
    text-align: center;
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 600;
    margin-top: 1.5rem;
}

    .auth-link:hover {
        text-decoration: underline;
    }

.auth-loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.auth-loader {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    animation: auth-spin 0.8s linear infinite;
}

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}
