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

:root {
    font-size: 16px;
    --bg: linear-gradient(145deg, #eef3ff 0%, #f9fbff 45%, #edf4ff 100%);
    --surface: #ffffff;
    --surface-soft: #f4f7ff;
    --border: #e2e8f4;
    --border-strong: #cdd6ea;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --accent: #111827;
    --danger: #ef4444;
    --warning: #fbbf24;
    --shadow-card: 0 35px 80px rgba(15, 23, 42, 0.14);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    background: var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: clamp(1.5rem, 5vw, 4rem);
}

.auth-shell {
    width: min(520px, 95vw);
    background: var(--surface);
    border-radius: 28px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
    overflow: hidden;
    padding: clamp(2.4rem, 5vw, 3.2rem);
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}

.auth-logo {
    display: flex;
    justify-content: center;
}

.auth-logo img {
    width: clamp(90px, 18vw, 110px);
    height: auto;
}

.auth-card {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
}

.auth-card header {
    text-align: center;
}

.auth-card header h2 {
    margin: 0;
    font-size: 1.85rem;
    font-weight: 700;
}

.auth-card header p {
    margin: 0.55rem 0 0;
    color: var(--text-secondary);
    font-size: 0.97rem;
}

.auth-form {
    display: grid;
    gap: 1.2rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.form-field label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.input-container {
    position: relative;
}

.input-container input {
    width: 100%;
    padding: 1rem 1.1rem 1rem 3rem;
    border-radius: 14px;
    border: 1px solid var(--border-strong);
    background: #f5f7ff;
    font-size: 1rem;
    transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input-container input:focus {
    background: #ffffff;
    border-color: var(--brand);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.input-container svg {
    position: absolute;
    top: 50%;
    left: 1.1rem;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    stroke: var(--text-secondary);
}

.form-extra {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-extra label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

.form-extra input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--brand);
}

.form-extra a {
    font-weight: 600;
    color: var(--brand);
}

.primary-action {
    width: 100%;
    border: none;
    border-radius: 15px;
    padding: 1rem 1rem;
    background: linear-gradient(140deg, var(--accent), #000000);
    color: #ffffff;
    font-weight: 600;
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    cursor: pointer;
    box-shadow: 0 22px 46px rgba(17, 24, 39, 0.26);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.primary-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 30px 55px rgba(17, 24, 39, 0.3);
}

.primary-action svg {
    width: 18px;
    height: 18px;
}

.divider {
    position: relative;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin: 1.5rem 0 1.3rem;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 42%;
    height: 1px;
    background: var(--border);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.trust-box {
    border-radius: 16px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    padding: 1.1rem 1.3rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    font-size: 0.92rem;
    color: var(--text-secondary);
}

.trust-box svg {
    width: 20px;
    height: 20px;
    stroke: var(--brand);
    margin-top: 0.1rem;
}

.alert {
    border-radius: 14px;
    padding: 0.9rem 1.1rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.alert-success {
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.22);
    color: #0f172a;
}

.alert-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.28);
    color: #991b1b;
}

.auth-footer {
    margin-top: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--text-secondary);
    font-size: 0.88rem;
    text-align: center;
}

.auth-footer a {
    color: var(--brand);
    font-weight: 600;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    backdrop-filter: blur(6px);
    background: rgba(11, 17, 30, 0.62);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    z-index: 80;
    animation: fadeIn 0.15s ease-out;
}

.modal-card {
    width: min(420px, 100%);
    border-radius: 24px;
    background: var(--surface);
    padding: 2rem 2.4rem;
    box-shadow: 0 40px 80px rgba(15, 23, 42, 0.28);
    border: 1px solid rgba(226, 232, 240, 0.8);
    text-align: left;
    position: relative;
}

.modal-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    border: 1px solid rgba(37, 99, 235, 0.12);
    pointer-events: none;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.2rem;
}

.modal-header .status-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 0;
}

.modal-card.error .status-icon {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.modal-card.info .status-icon {
    background: rgba(37, 99, 235, 0.12);
    color: var(--brand);
}

.modal-card h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-card p {
    margin: 0 0 1.6rem;
    color: var(--text-secondary);
    font-size: 0.98rem;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
}

.modal-close {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    border: none;
    border-radius: 12px;
    color: #ffffff;
    padding: 0.75rem 1.65rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.modal-close:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.28);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 640px) {
    :root {
        font-size: 15px;
    }

    .auth-wrapper {
        padding: 1.25rem;
    }

    .auth-shell {
        border-radius: 20px;
        padding: 2rem 1.6rem 2.4rem;
        gap: 1.6rem;
    }

    .auth-card {
        gap: 1.6rem;
    }

    .form-extra {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .primary-action {
        font-size: 1rem;
    }

    .auth-footer {
        font-size: 0.8rem;
    }
}
