/**
 * ========================================
 * EL PATRÓN TIERRA - AUTH STYLES
 * ========================================
 * Estilos para páginas de autenticación
 */

/* ========================================
   PÁGINA DE AUTH - BASE
   ======================================== */

.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color-dark);
    overflow-x: hidden;
}

/* ========================================
   FONDO ANIMADO
   ======================================== */

.auth-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.auth-bg__gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(201, 169, 98, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 90, 66, 0.08) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 50%, rgba(201, 169, 98, 0.05) 0%, transparent 60%);
    animation: gradientShift 15s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.auth-bg__grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(201, 169, 98, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(201, 169, 98, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* ========================================
   HEADER MINIMAL
   ======================================== */

.auth-header {
    position: relative;
    z-index: 10;
    padding: var(--space-lg);
    display: flex;
    justify-content: center;
}

.auth-header__logo img {
    width: 60px;
    height: auto;
    transition: transform 0.3s ease;
}

.auth-header__logo:hover img {
    transform: scale(1.05);
}

/* ========================================
   CONTENEDOR PRINCIPAL
   ======================================== */

.auth-container {
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

/* ========================================
   CARD DE AUTENTICACIÓN
   ======================================== */

.auth-card {
    width: 100%;
    max-width: 440px;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.9) 0%, rgba(20, 20, 20, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: var(--space-xl);
    backdrop-filter: blur(20px);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 100px rgba(201, 169, 98, 0.05);
}

/* ========================================
   TABS DE NAVEGACIÓN
   ======================================== */

.auth-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: var(--space-xl);
}

.auth-tab {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-gray-400);
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-tab:hover {
    color: var(--color-white);
}

.auth-tab--active {
    background: rgba(201, 169, 98, 0.2);
    color: var(--color-gold);
}

/* ========================================
   FORMULARIOS
   ======================================== */

.auth-form {
    animation: fadeIn 0.3s ease;
}

.auth-form--hidden {
    display: none;
}

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

.auth-form__header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.auth-form__title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 400;
    color: var(--color-white);
    margin-bottom: var(--space-xs);
}

.auth-form__subtitle {
    font-size: var(--text-sm);
    color: var(--color-gray-400);
}

.auth-form__group {
    margin-bottom: var(--space-md);
}

.auth-form__label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-gray-300);
    margin-bottom: 8px;
}

.auth-form__input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--color-white);
    transition: all 0.3s ease;
}

.auth-form__input::placeholder {
    color: var(--color-gray-600);
}

.auth-form__input:focus {
    outline: none;
    border-color: var(--color-gold);
    background: rgba(201, 169, 98, 0.05);
    box-shadow: 0 0 0 3px rgba(201, 169, 98, 0.1);
}

.auth-form__input:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

/* Password wrapper */
.auth-form__password-wrapper {
    position: relative;
}

.auth-form__password-wrapper .auth-form__input {
    padding-right: 48px;
}

.auth-form__password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-gray-500);
    cursor: pointer;
    padding: 4px;
    transition: color 0.3s ease;
}

.auth-form__password-toggle:hover {
    color: var(--color-white);
}

/* Forgot password link */
.auth-form__forgot {
    display: inline-block;
    margin-top: 8px;
    font-size: var(--text-sm);
    color: var(--color-gold);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.auth-form__forgot:hover {
    opacity: 0.8;
}

/* Password strength */
.auth-form__password-strength {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.strength-bar::before {
    content: '';
    display: block;
    height: 100%;
    width: 0;
    background: var(--color-gold);
    transition: width 0.3s ease, background 0.3s ease;
}

.strength-bar[data-strength="weak"]::before {
    width: 33%;
    background: #ef4444;
}

.strength-bar[data-strength="medium"]::before {
    width: 66%;
    background: #f59e0b;
}

.strength-bar[data-strength="strong"]::before {
    width: 100%;
    background: #22c55e;
}

.strength-text {
    font-size: var(--text-xs);
    color: var(--color-gray-500);
}

/* Checkbox */
.auth-form__checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--color-gray-400);
}

.auth-form__checkbox input {
    display: none;
}

.auth-form__checkbox .checkmark {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.auth-form__checkbox input:checked + .checkmark {
    background: var(--color-gold);
    border-color: var(--color-gold);
}

.auth-form__checkbox input:checked + .checkmark::after {
    content: '✓';
    color: var(--color-dark);
    font-size: 12px;
    font-weight: bold;
}

.auth-form__checkbox a {
    color: var(--color-gold);
    text-decoration: none;
}

.auth-form__checkbox a:hover {
    text-decoration: underline;
}

/* Error message */
.auth-form__error {
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    color: #fca5a5;
    font-size: var(--text-sm);
    margin-bottom: var(--space-md);
    display: none;
}

.auth-form__error.visible {
    display: block;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Success message */
.auth-form__success {
    padding: 12px 16px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 10px;
    color: #86efac;
    font-size: var(--text-sm);
    margin-bottom: var(--space-md);
    display: none;
}

.auth-form__success.visible {
    display: block;
}

/* ========================================
   BOTONES
   ======================================== */

.btn--full {
    width: 100%;
    justify-content: center;
}

.btn--gold {
    background: linear-gradient(135deg, var(--color-gold) 0%, #d4a853 100%);
    color: var(--color-dark);
    font-weight: 600;
    padding: 16px 32px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn--gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(201, 169, 98, 0.3);
}

.btn--gold:active {
    transform: translateY(0);
}

.btn--gold.loading .btn__text {
    opacity: 0;
}

.btn--gold.loading .btn__loader {
    opacity: 1;
}

.btn__loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-dark);
    border-top-color: transparent;
    border-radius: 50%;
    opacity: 0;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ========================================
   DIVIDER
   ======================================== */

.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-lg) 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.auth-divider span {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
}

/* ========================================
   BOTÓN SOCIAL
   ======================================== */

.auth-social-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--color-white);
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-social-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* ========================================
   MODAL
   ======================================== */

.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.auth-modal.visible {
    opacity: 1;
    visibility: visible;
}

.auth-modal__content {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.95) 0%, rgba(20, 20, 20, 0.98) 100%);
    border: 1px solid rgba(201, 169, 98, 0.3);
    border-radius: 20px;
    padding: var(--space-xl);
    max-width: 400px;
    width: 90%;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.auth-modal.visible .auth-modal__content {
    transform: scale(1);
}

.auth-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--color-gray-400);
    cursor: pointer;
    padding: 4px;
    transition: color 0.3s ease;
}

.auth-modal__close:hover {
    color: var(--color-white);
}

.auth-modal__title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    color: var(--color-white);
    margin-bottom: var(--space-sm);
}

.auth-modal__text {
    font-size: var(--text-sm);
    color: var(--color-gray-400);
    margin-bottom: var(--space-lg);
    line-height: 1.6;
}

/* ========================================
   MENSAJE DE VERIFICACIÓN
   ======================================== */

.auth-message {
    display: none;
    text-align: center;
    padding: var(--space-xl);
}

.auth-message.visible {
    display: block;
    animation: fadeIn 0.5s ease;
}

.auth-message__icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 50%;
    color: #22c55e;
}

.auth-message__title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    color: var(--color-white);
    margin-bottom: var(--space-sm);
}

.auth-message__text {
    font-size: var(--text-sm);
    color: var(--color-gray-400);
    margin-bottom: var(--space-lg);
    line-height: 1.6;
}

/* ========================================
   FOOTER
   ======================================== */

.auth-footer {
    position: relative;
    z-index: 10;
    padding: var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-footer p {
    font-size: var(--text-sm);
    color: var(--color-gray-600);
}

.auth-footer__links {
    display: flex;
    gap: var(--space-md);
}

.auth-footer__links a {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
    text-decoration: none;
    transition: color 0.3s ease;
}

.auth-footer__links a:hover {
    color: var(--color-gold);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 640px) {
    .auth-card {
        padding: var(--space-lg);
        border-radius: 20px;
    }
    
    .auth-footer {
        flex-direction: column;
        gap: var(--space-sm);
        text-align: center;
    }
}
