/* ================================================================ */
/*                    GLOBAL RESET + VARIABLES                      */
/* ================================================================ */
:root {
    /* Acento — usado con moderación (CTAs, estado activo, links) */
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --accent-soft: rgba(0, 113, 227, 0.1);

    /* Estados semánticos (solo para indicadores puntuales, no para bloques grandes) */
    --success: #2fa84f;
    --danger: #e5342a;
    --danger-soft: rgba(229, 52, 42, 0.1);
    --warning: #c9820a;
    --neutral: #86868b;

    /* Superficies */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f7;
    --bg-elevated: #ffffff;
    --surface-fill: #eeeef0;

    /* Texto */
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-tertiary: #86868b;
    --text-on-accent: #ffffff;

    /* Líneas */
    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.12);
    --fill-hover: rgba(0, 0, 0, 0.04);
    --fill-active: rgba(0, 0, 0, 0.06);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.10), 0 2px 8px rgba(0, 0, 0, 0.04);

    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 20px;
    --spacing-xl: 24px;
    --spacing-2xl: 32px;
    --spacing-3xl: 40px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --accent: #2997ff;
        --accent-hover: #4ba3ff;
        --accent-soft: rgba(41, 151, 255, 0.15);

        --success: #3dd160;
        --danger: #ff4b3e;
        --danger-soft: rgba(255, 75, 62, 0.15);
        --warning: #e6a23c;
        --neutral: #98989d;

        --bg-primary: #000000;
        --bg-secondary: #000000;
        --bg-elevated: #1c1c1e;
        --surface-fill: #2c2c2e;

        --text-primary: #f5f5f7;
        --text-secondary: #a1a1a6;
        --text-tertiary: #6e6e73;

        --border: rgba(255, 255, 255, 0.09);
        --border-strong: rgba(255, 255, 255, 0.14);
        --fill-hover: rgba(255, 255, 255, 0.06);
        --fill-active: rgba(255, 255, 255, 0.09);

        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 2px 10px rgba(0, 0, 0, 0.35);
        --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 62.5%;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Inter', sans-serif;
    font-size: 1.6rem;
    line-height: 1.45;
    background: var(--bg-secondary);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background-color: var(--accent-soft);
    color: var(--text-primary);
}

svg {
    display: block;
}

.icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ================================================================ */
/*                          AUTH SHELL                              */
/* ================================================================ */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl) var(--spacing-md);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-2xl);
}

.auth-brand {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-lg);
}

.auth-brand-mark {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.auth-title {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 6px;
    line-height: 1.2;
}

.auth-subtitle {
    font-size: 1.4rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.5;
    margin-bottom: var(--spacing-xl);
}

/* ================================================================ */
/*                            FORM                                  */
/* ================================================================ */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field label {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: -0.1px;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-tertiary);
    pointer-events: none;
}

.input-wrap input {
    width: 100%;
    font-family: inherit;
    font-size: 1.5rem;
    padding: 0 var(--spacing-md) 0 42px;
    height: 46px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-strong);
    background: var(--surface-fill);
    color: var(--text-primary);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.input-wrap input::placeholder {
    color: var(--text-tertiary);
}

.input-wrap input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-elevated);
}

.input-wrap-toggle input {
    padding-right: 44px;
}

.input-toggle {
    position: absolute;
    right: 6px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-tertiary);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.input-toggle:hover {
    background: var(--fill-hover);
    color: var(--text-primary);
}

/* ================================================================ */
/*                           BUTTON                                 */
/* ================================================================ */
.btn-primary {
    background: var(--accent);
    color: var(--text-on-accent);
    border: none;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    min-height: 46px;
    letter-spacing: -0.2px;
    font-family: inherit;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-primary:active {
    transform: scale(0.99);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: default;
}

.auth-submit {
    width: 100%;
    margin-top: 6px;
}

.btn-label {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.spin {
    animation: spin 0.9s linear infinite;
}

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

/* ================================================================ */
/*                          MESSAGES                                */
/* ================================================================ */
.form-error {
    font-size: 1.3rem;
    color: var(--danger);
    background: var(--danger-soft);
    border-radius: var(--radius-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    line-height: 1.4;
    text-align: center;
}

.form-error:empty {
    display: none;
    padding: 0;
}

/* ================================================================ */
/*                          RESPONSIVE                              */
/* ================================================================ */
@media (max-width: 480px) {
    .auth-card {
        padding: var(--spacing-xl) var(--spacing-lg);
    }

    .auth-title {
        font-size: 2.1rem;
    }
}

/* Focus styles for accessibility */
button:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
