/* VARIABLES  */
:root {
    --azul-principal: #2572B1;
    --azul-claro: #7BB5DC;
    --verde-principal: #659578;
    --verde-claro: #8ACC9C;
    --verde-muy-claro: #C7DDCE;
    --gris-fondo: #f8fafc;
    --blanco: #ffffff;
    --texto-oscuro: #1e2a3e;
    --texto-suave: #4a5b6e;
    --border-subtle: rgba(37, 114, 177, 0.12);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 30px -8px rgba(0,0,0,0.12);
    --radius-card: 1.25rem;
    --radius-sm: 0.75rem;
    --transition: all 0.3s ease;
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Inter', 'Segoe UI', sans-serif;
}

/*  BASE */
.auth-body {
    background: var(--gris-fondo);
    min-height: 100vh;
    font-family: var(--font-sans);
    color: var(--texto-oscuro);
    display: flex;
    flex-direction: column;
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-container {
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
}

/* Para registro (más ancho) */
.auth-container-wide {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
}

/* TARJETA CON EFECTO FOCUS VERDE*/
.auth-card {
    background: var(--blanco);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-md);
    border: 2px solid transparent;
    overflow: hidden;
    position: relative;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.auth-card:focus-within {
    border-color: var(--verde-principal);
    box-shadow: 0 0 0 4px rgba(101, 149, 120, 0.15), var(--shadow-lg);
}

/* Borde superior degradado (igual que en el index) */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--azul-principal), var(--verde-principal));
    z-index: 2;
}

.auth-card-body {
    padding: 2.5rem 2rem;
    position: relative;
}

/*LOGO Y TÍTULOS*/
.auth-logo {
    max-width: 160px;
    height: auto;
    display: block;
    margin: 0 auto 1.5rem;
}

.auth-logo-sm {
    max-width: 120px;
}

.auth-title {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--azul-principal);
    text-align: center;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

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

.auth-subtitle i {
    color: var(--azul-principal);
}

/*BOTÓN "VOLVER"  */
.auth-btn-back {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: transparent;
    border: 1.5px solid var(--azul-principal);
    color: var(--azul-principal);
    padding: 0.3rem 1rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.8rem;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    z-index: 3;
}

.auth-btn-back:hover {
    background: var(--azul-principal);
    color: white;
    text-decoration: none;
}

/* INPUTS CON ICONO + PLACEHOLDER + OJO  */
.auth-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--texto-oscuro);
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.auth-label i {
    color: var(--azul-principal);
    font-size: 1rem;
}

.auth-input-group {
    display: flex;
    align-items: center;
    border-radius: var(--radius-sm);
    border: 1.5px solid #e2e8f0;
    background: var(--blanco);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input-group:focus-within {
    border-color: var(--verde-principal);
    box-shadow: 0 0 0 3px rgba(101, 149, 120, 0.12);
}

.auth-input-icon {
    padding: 0 0 0 1rem;
    color: var(--azul-principal);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.auth-form-control,
.auth-form-select {
    border: none;
    padding: 0.6rem 1rem 0.6rem 0.6rem;
    font-size: 0.95rem;
    color: var(--texto-oscuro);
    background: transparent;
    width: 100%;
    outline: none;
    font-family: var(--font-sans);
    border-radius: 0;
}

.auth-form-control::placeholder {
    color: #a0aec0;
}

.auth-form-select {
    appearance: auto;
    background-color: var(--blanco);
    cursor: pointer;
}

.auth-form-control:read-only,
.auth-form-select:disabled {
    background-color: var(--gris-fondo);
    cursor: not-allowed;
}

.auth-toggle-pass {
    padding: 0.6rem 1rem;
    background: transparent;
    border: none;
    color: var(--azul-principal);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
}

.auth-toggle-pass:hover {
    color: var(--verde-principal);
}

/*  BOTÓN PRINCIPAL */
.auth-btn-primary {
    background: linear-gradient(135deg, var(--azul-principal), var(--azul-claro));
    border: none;
    color: white;
    padding: 0.7rem 1.5rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    box-shadow: 0 4px 10px rgba(37, 114, 177, 0.2);
    cursor: pointer;
    font-family: var(--font-sans);
}

.auth-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 114, 177, 0.3);
    color: white;
    background: linear-gradient(135deg, #1e5f8e, var(--azul-principal));
}

/* ENLACES */
.auth-divider {
    border: 0;
    border-top: 1px solid var(--border-subtle);
    margin: 1.8rem 0;
}

.auth-link {
    color: var(--azul-principal);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.9rem;
}

.auth-link:hover {
    color: var(--verde-principal);
    text-decoration: underline;
}

.auth-link-secondary {
    color: var(--texto-suave);
    font-size: 0.85rem;
    transition: var(--transition);
}

.auth-link-secondary:hover {
    color: var(--azul-principal);
    text-decoration: underline;
}

/* SECCIONES INTERNAS*/
.auth-section {
    background: var(--gris-fondo);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 1.2rem 1.2rem 0.5rem;
    margin-bottom: 1.5rem;
}

.auth-section-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--azul-principal);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-section-title i {
    color: var(--verde-principal);
}

/* DOCS BOX Y FILE INPUTS*/
.auth-docs-box {
    background: var(--blanco);
    border: 1px dashed var(--azul-claro);
    border-radius: var(--radius-sm);
    padding: 1.2rem;
}

.auth-msg-ayuda {
    font-size: 0.8rem;
    color: var(--texto-suave);
    margin-top: 0.2rem;
}

.auth-file-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.auth-file-wrapper input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.auth-file-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--blanco);
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--texto-oscuro);
    transition: var(--transition);
    width: 100%;
    text-align: center;
    cursor: pointer;
}

.auth-file-custom i {
    color: var(--azul-principal);
    font-size: 1.2rem;
}

.auth-file-custom:hover {
    border-color: var(--azul-principal);
    background: var(--gris-fondo);
}

.auth-file-custom span {
    flex: 1;
    text-align: left;
}

/* RESPONSIVE*/
@media (max-width: 992px) {
    .auth-container-wide {
        max-width: 100%;
        padding: 0 1rem;
    }
}

@media (max-width: 768px) {
    .auth-card-body {
        padding: 1.8rem 1.2rem;
    }
    .auth-btn-back {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 1rem;
        display: inline-block;
    }
    .auth-logo {
        max-width: 130px;
    }
    .auth-logo-sm {
        max-width: 100px;
    }
}

@media (max-width: 576px) {
    .auth-card-body {
        padding: 1.5rem 0.8rem;
    }
    .auth-title {
        font-size: 1.2rem;
    }
    .auth-section {
        padding: 0.8rem;
    }
    .auth-input-icon {
        padding-left: 0.6rem;
    }
    .auth-form-control,
    .auth-form-select {
        padding: 0.5rem 0.6rem 0.5rem 0.3rem;
        font-size: 0.9rem;
    }
    .auth-toggle-pass {
        padding: 0.5rem 0.6rem;
    }
    .auth-btn-primary {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }
    .auth-file-custom {
        font-size: 0.8rem;
        padding: 0.5rem 0.8rem;
    }
}

/* UTILIDADES ADICIONALES */
.text-success {
    color: var(--verde-principal) !important;
}
.text-danger {
    color: #dc3545 !important;
}
.is-valid {
    border-color: var(--verde-principal) !important;
}
.is-invalid {
    border-color: #dc3545 !important;
}