/* styles/pages/security/login_register_form.css */

/* ============================================
   AUTH CONTAINER - Layout principal
   ============================================ */
.auth-container {
    max-width: 520px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100vh - 156px); /* 76px navbar + 80px padding */
}

/* ============================================
   HEADER - Título y subtítulo
   ============================================ */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeInDown 0.6s ease;
}

.auth-title {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--light);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.4);
    position: relative;
}

.auth-title::after {
    content: '';
    display: block;
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--secondary));
    margin: 1rem auto 0;
    border-radius: 2px;
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.4);
    animation: expandWidth 0.8s ease 0.3s both;
}

.auth-subtitle {
    font-size: 1.1rem;
    color: rgba(236, 240, 241, 0.85);
    font-weight: 300;
    margin-top: 1.5rem;
    letter-spacing: 0.5px;
}

/* ============================================
   ALERTS - Mensajes flash mejorados
   ============================================ */
.alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.5rem;
    border-radius: 12px;
    border: none;
    border-left: 4px solid;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.4s ease;
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.alert-content i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.alert-content span {
    color: var(--light);
    font-size: 0.95rem;
    font-weight: 500;
}

.alert-success {
    border-left-color: var(--success);
}

.alert-success .alert-content i {
    color: var(--success);
}

.alert-error {
    border-left-color: var(--danger);
}

.alert-error .alert-content i {
    color: var(--danger);
}

.btn-close {
    background: none;
    border: none;
    color: rgba(236, 240, 241, 0.6);
    cursor: pointer;
    padding: 0.25rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--light);
    transform: rotate(90deg);
}

.btn-close i {
    font-size: 0.9rem;
}

/* ============================================
   CARD - Contenedor del formulario
   ============================================ */
.auth-card {
    background: rgba(44, 62, 80, 0.3);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    padding: 2.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.6s ease 0.2s both;
}

.auth-card:hover {
    border-color: rgba(52, 152, 219, 0.3);
    box-shadow: 0 12px 48px rgba(52, 152, 219, 0.2);
    transform: translateY(-5px);
}

/* ============================================
   FORM GROUPS - Estructura de campos
   ============================================ */
.form-group {
    margin-bottom: 1.75rem;
    position: relative;
}

.form-label {
    display: block;
    color: var(--light);
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

/* ============================================
   INPUT WRAPPER - Contenedor de input + iconos
   ============================================ */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1.1rem;
    color: rgba(236, 240, 241, 0.5);
    font-size: 1.05rem;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.input-wrapper.focused .input-icon {
    color: var(--accent);
    transform: scale(1.15);
}

/* ============================================
   FORM CONTROLS - Inputs
   ============================================ */
.form-control {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 1rem 1rem 1rem 3rem;
    color: var(--light);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.2);
    transform: translateY(-2px);
}

.form-control::placeholder {
    color: rgba(236, 240, 241, 0.45);
    font-size: 0.95rem;
}

/* Input with toggle password button */
.input-wrapper .password-field {
    padding-right: 3rem;
}

/* Error state */
.form-group.has-error .form-control {
    border-color: var(--danger);
    background: rgba(231, 76, 60, 0.1);
}

.form-group.has-error .form-control:focus {
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.15);
}

.form-group.has-error .input-icon {
    color: var(--danger);
}

/* ============================================
   TOGGLE PASSWORD BUTTON
   ============================================ */
.toggle-password {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: rgba(236, 240, 241, 0.5);
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.2s ease;
    z-index: 2;
    border-radius: 6px;
}

.toggle-password:hover {
    color: var(--accent);
    background: rgba(52, 152, 219, 0.1);
}

.toggle-password:active {
    transform: scale(0.95);
}

.toggle-password i {
    font-size: 1rem;
}

/* ============================================
   FORM HINT - Texto de ayuda
   ============================================ */
.form-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(236, 240, 241, 0.7);
    font-size: 0.85rem;
    margin-top: 0.6rem;
    padding-left: 0.25rem;
    line-height: 1.5;
}

.form-hint i {
    color: var(--accent);
    font-size: 0.85rem;
}

/* ============================================
   FORM ERRORS - Mensajes de error
   ============================================ */
.invalid-feedback,
ul.invalid-feedback {
    display: block;
    margin: 0.6rem 0 0 0;
    padding: 0.75rem 1rem;
    list-style: none;
    color: #FFB3B3;
    font-size: 0.875rem;
    background: rgba(231, 76, 60, 0.15);
    border-radius: 8px;
    border-left: 3px solid var(--danger);
    animation: shake 0.4s ease;
}

.invalid-feedback li::before {
    content: '\f06a';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 0.5rem;
    color: var(--danger);
}

/* ============================================
   SUBMIT BUTTON
   ============================================ */
.btn-auth {
    width: 100%;
    padding: 1.15rem 2rem;
    font-size: 1.05rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(52, 152, 219, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
    position: relative;
    overflow: hidden;
}

/* Shimmer effect on button */
.btn-auth::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.6s ease;
}

.btn-auth:hover::before {
    left: 100%;
}

.btn-auth:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(52, 152, 219, 0.5);
}

.btn-auth:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(52, 152, 219, 0.4);
}

.btn-auth i {
    font-size: 1.15rem;
}

/* ============================================
   FOOTER LINK
   ============================================ */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    animation: fadeIn 0.8s ease 0.6s both;
}

.auth-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--light);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 1rem 2rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.auth-link:hover {
    background: rgba(52, 152, 219, 0.2);
    border-color: rgba(52, 152, 219, 0.4);
    transform: translateY(-2px);
    color: var(--light);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.25);
}

.auth-link i {
    transition: transform 0.3s ease;
}

.auth-link:hover i {
    transform: translateX(4px);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes expandWidth {
    from {
        width: 0;
    }
    to {
        width: 100px;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.form-check-wrapper {
    margin: 1.25rem 0;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
    border-radius: 4px;
}

.form-check-label {
    color: rgba(236, 240, 241, 0.9);
    font-size: 0.95rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.form-check:hover .form-check-label {
    color: var(--light);
}

.auth-divider {
    position: relative;
    text-align: center;
    margin: 2rem 0 1.5rem;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent
    );
}

.auth-divider span {
    position: relative;
    background: rgba(44, 62, 80, 0.3);
    padding: 0 1rem;
    color: rgba(236, 240, 241, 0.6);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-option-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: rgba(236, 240, 241, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    text-align: center;
    justify-content: center;
}

.auth-option-link:hover {
    background: rgba(52, 152, 219, 0.15);
    color: var(--accent);
    transform: translateX(5px);
}

.auth-option-link i {
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .auth-container {
        padding: 1.5rem 1rem;
        min-height: calc(100vh - 136px);
    }

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

    .auth-subtitle {
        font-size: 1rem;
    }

    .auth-card {
        padding: 2rem 1.5rem;
        border-radius: 16px;
    }

    .form-group {
        margin-bottom: 1.5rem;
    }

    .form-control {
        padding: 0.95rem 1rem 0.95rem 2.8rem;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 1rem;
    }

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

    .auth-title::after {
        width: 80px;
    }

    .auth-subtitle {
        font-size: 0.95rem;
        margin-top: 1.25rem;
    }

    .auth-card {
        padding: 1.75rem 1.25rem;
        border-radius: 14px;
    }

    .form-label {
        font-size: 0.9rem;
    }

    .form-control {
        padding: 0.85rem 0.9rem 0.85rem 2.6rem;
        font-size: 16px;
    }

    .btn-auth {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }

    .auth-link {
        padding: 0.85rem 1.5rem;
        font-size: 0.9rem;
    }

    .alert {
        padding: 0.9rem 1.25rem;
    }

    .alert-content span {
        font-size: 0.9rem;
    }


    .form-check-label {
        font-size: 0.85rem;
    }

    .auth-divider {
        margin: 1.5rem 0 1rem;
    }

    .auth-option-link {
        font-size: 0.85rem;
        padding: 0.65rem 0.85rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
.form-control:focus-visible,
.btn-auth:focus-visible,
.auth-link:focus-visible,
.toggle-password:focus-visible,
.btn-close:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}