/* ── Auth pages – light mint theme ───────────────────────────── */

:root {
    --auth-bg:              #e8f5f2;
    --auth-card-bg:         #ffffff;
    --auth-card-shadow:     0 4px 24px rgba(0, 0, 0, 0.08);
    --auth-card-border:     #e2e8f0;

    --primary:              #14b8a6;
    --primary-dark:         #0d9488;
    --primary-text:         #0f766e;

    --text-dark:            #1e293b;
    --text-muted:           #64748b;
    --text-light:           #94a3b8;
    --input-border:         #cbd5e1;
    --input-border-focus:   #14b8a6;
    --input-icon:           #94a3b8;
    --label-color:          #334155;

    /* Role colours */
    --master-color:         #f59e0b;
    --master-bg:            #fffbeb;
    --master-border:        #fcd34d;

    --admin-color:          #ffffff;
    --admin-bg:             #14b8a6;
    --admin-border:         #14b8a6;

    --residente-color:      #3b82f6;
    --residente-bg:         #eff6ff;
    --residente-border:     #93c5fd;

    --seguridad-color:      #10b981;
    --seguridad-bg:         #f0fdf4;
    --seguridad-border:     #6ee7b7;
}

/* ── Reset / base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

.auth-body {
    min-height: 100vh;
    background-color: var(--auth-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    color: var(--text-dark);
    padding: 2rem 1rem;
    margin: 0;
}

/* ── Logo block (above card) ────────────────────────────────── */
.auth-logo-wrap {
    text-align: center;
    margin-bottom: 1.25rem;
}

.auth-logo-icon {
    width: 64px;
    height: 64px;
    background: #d1faf4;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.auth-logo-icon svg {
    width: 34px;
    height: 34px;
    color: var(--primary);
}

.auth-app-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 0.25rem;
    letter-spacing: -0.02em;
}

.auth-app-sub {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 0;
}

/* ── Card ───────────────────────────────────────────────────── */
.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-card-border);
    border-radius: 1.25rem;
    padding: 2rem 2rem 1.75rem;
    box-shadow: var(--auth-card-shadow);
}

.auth-card-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    margin: 0 0 0.35rem;
}

.auth-card-subtitle {
    font-size: 0.83rem;
    color: var(--text-muted);
    text-align: center;
    margin: 0 0 1.5rem;
}

/* ── Role selector ──────────────────────────────────────────── */
.role-section-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--label-color);
    margin-bottom: 0.6rem;
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.role-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.65rem 0.25rem;
    border-radius: 0.75rem;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.15s ease;
    background: transparent;
    line-height: 1.2;
}

.role-btn svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

/* Master – amber */
.role-btn[data-role="Master"] {
    background: var(--master-bg);
    border-color: var(--master-border);
    color: var(--master-color);
}
.role-btn[data-role="Master"]:hover,
.role-btn[data-role="Master"].active {
    background: #fef3c7;
    border-color: var(--master-color);
}

/* Administracion – teal (default active) */
.role-btn[data-role="Administracion"] {
    background: var(--admin-bg);
    border-color: var(--admin-border);
    color: var(--admin-color);
}
.role-btn[data-role="Administracion"]:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* Residente – blue */
.role-btn[data-role="Residente"] {
    background: var(--residente-bg);
    border-color: var(--residente-border);
    color: var(--residente-color);
}
.role-btn[data-role="Residente"]:hover,
.role-btn[data-role="Residente"].active {
    background: #dbeafe;
    border-color: var(--residente-color);
}

/* Seguridad – green */
.role-btn[data-role="Seguridad"] {
    background: var(--seguridad-bg);
    border-color: var(--seguridad-border);
    color: var(--seguridad-color);
}
.role-btn[data-role="Seguridad"]:hover,
.role-btn[data-role="Seguridad"].active {
    background: #dcfce7;
    border-color: var(--seguridad-color);
}

/* Non-admin active state: solid bg */
.role-btn[data-role="Master"].active {
    background: var(--master-color);
    border-color: var(--master-color);
    color: #fff;
}
.role-btn[data-role="Residente"].active {
    background: var(--residente-color);
    border-color: var(--residente-color);
    color: #fff;
}
.role-btn[data-role="Seguridad"].active {
    background: var(--seguridad-color);
    border-color: var(--seguridad-color);
    color: #fff;
}
.role-btn[data-role="Administracion"].active {
    background: var(--admin-bg);
    border-color: var(--admin-border);
    color: #fff;
}

/* ── Form controls ──────────────────────────────────────────── */
.auth-field {
    margin-bottom: 1.1rem;
}

.auth-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--label-color);
    margin-bottom: 0.4rem;
}

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

.auth-input-icon {
    position: absolute;
    left: 0.85rem;
    color: var(--input-icon);
    display: flex;
    align-items: center;
    pointer-events: none;
}

.auth-input-icon svg {
    width: 17px;
    height: 17px;
}

.auth-input {
    width: 100%;
    padding: 0.65rem 0.85rem 0.65rem 2.5rem;
    border: 1.5px solid var(--input-border);
    border-radius: 0.6rem;
    font-size: 0.9rem;
    color: var(--text-dark);
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input::placeholder {
    color: var(--text-light);
}

.auth-input:focus {
    border-color: var(--input-border-focus);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

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

/* Password eye toggle */
.auth-input-right {
    position: absolute;
    right: 0.85rem;
    background: none;
    border: none;
    color: var(--input-icon);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

.auth-input-right:hover {
    color: var(--text-muted);
}

.auth-input-right svg {
    width: 18px;
    height: 18px;
}

.field-error {
    font-size: 0.78rem;
    color: #ef4444;
    margin-top: 0.3rem;
    display: block;
}

/* ── Forgot password ────────────────────────────────────────── */
.forgot-link {
    font-size: 0.82rem;
    color: var(--primary);
    text-decoration: none;
    float: right;
}

.forgot-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ── Submit button ──────────────────────────────────────────── */
.btn-auth {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: var(--primary);
    border: none;
    border-radius: 0.6rem;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: background 0.2s, transform 0.1s;
    margin-top: 1.35rem;
}

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

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

.btn-auth:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ── Demo notice ────────────────────────────────────────────── */
.demo-notice {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 1.25rem;
}

/* ── Validation summary ─────────────────────────────────────── */
.auth-validation-summary {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 0.5rem;
    padding: 0.65rem 0.85rem;
    font-size: 0.82rem;
    color: #dc2626;
    margin-bottom: 1rem;
}

.auth-validation-summary ul {
    margin: 0;
    padding-left: 1.2rem;
}
