/**
 * Professional Login/Register Pages Styles
 * Modern, responsive design with smooth animations
 */

/* ===== ROOT VARIABLES ===== */
:root {
    --auth-primary: #4B382F;
    --auth-primary-light: #6B5B4F;
    --auth-secondary: #8B4513;
    --auth-accent: #E1AA05;
    --auth-base: #FBF8F1;
    --auth-success: #28a745;
    --auth-danger: #dc3545;
    --auth-warning: #ffc107;
    --auth-info: #17a2b8;
    --auth-light: #f8f9fa;
    --auth-dark: #343a40;
    --auth-white: #ffffff;
    --auth-gray-100: #f8f9fa;
    --auth-gray-200: #e9ecef;
    --auth-gray-300: #dee2e6;
    --auth-gray-400: #ced4da;
    --auth-gray-500: #adb5bd;
    --auth-gray-600: #6c757d;
    --auth-gray-700: #495057;
    --auth-gray-800: #343a40;
    --auth-gray-900: #212529;
    
    --auth-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --auth-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --auth-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    --auth-shadow-xl: 0 2rem 4rem rgba(0, 0, 0, 0.2);
    
    --auth-border-radius: 0.75rem;
    --auth-border-radius-sm: 0.5rem;
    --auth-border-radius-lg: 1rem;
    
    --auth-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --auth-transition-fast: all 0.15s ease;
}

/* ===== MAIN CONTAINER ===== */
.login-register-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: var(--auth-base);
    position: relative;
    overflow: hidden;
}

.login-register-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(75, 56, 47, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(225, 170, 5, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.3) 0%, transparent 50%);
    z-index: 1;
}

.auth-wrapper {
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 2;
}

/* ===== BACKGROUND SHAPES ===== */
.auth-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 1;
}

.auth-shapes {
    position: relative;
    width: 100%;
    height: 100%;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(225, 170, 5, 0.15);
    animation: float 6s ease-in-out infinite;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(225, 170, 5, 0.2);
}

.shape-1 {
    width: 200px;
    height: 200px;
    top: 10%;
    left: -10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 150px;
    height: 150px;
    top: 60%;
    right: -5%;
    animation-delay: 2s;
}

.shape-3 {
    width: 100px;
    height: 100px;
    top: 30%;
    right: 20%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* ===== AUTH CARD ===== */
.auth-card {
    background: var(--auth-white);
    border-radius: var(--auth-border-radius-lg);
    box-shadow: var(--auth-shadow-xl);
    overflow: hidden;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(225, 170, 5, 0.2);
    position: relative;
    z-index: 2;
}

/* ===== HEADER ===== */
.auth-header {
    text-align: center;
    padding: 3rem 2rem 2rem;
    background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-primary-light) 100%);
    color: var(--auth-white);
    position: relative;
    overflow: hidden;
}

.auth-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    z-index: 1;
}

.auth-header > * {
    position: relative;
    z-index: 2;
}

.auth-logo .logo-img {
    max-height: 60px;
    width: auto;
    margin-bottom: 1rem;
    filter: brightness(0) invert(1);
}

.auth-logo .logo-text {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: var(--auth-white);
}

.auth-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
    font-weight: 300;
}

/* ===== TABS ===== */
.auth-tabs {
    display: flex;
    background: var(--auth-gray-100);
    border-bottom: 1px solid var(--auth-gray-200);
}

.auth-tab {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--auth-gray-600);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--auth-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
}

.auth-tab:hover {
    color: var(--auth-primary);
    background: rgba(75, 56, 47, 0.05);
}

.auth-tab.active {
    color: var(--auth-primary);
    background: var(--auth-white);
    box-shadow: 0 -2px 0 var(--auth-primary);
}

.auth-tab i {
    font-size: 1rem;
}

/* ===== FORMS ===== */
.auth-form {
    display: none;
    padding: 2rem;
    animation: fadeInUp 0.5s ease;
}

.auth-form.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== FORM GROUPS ===== */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--auth-gray-700);
    font-size: 0.9rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    z-index: 5;
}

.input-wrapper i {
    position: absolute;
    left: 1rem;
    color: var(--auth-gray-400);
    z-index: 2;
    font-size: 0.9rem;
}

.input-wrapper input,
.input-wrapper select {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.5rem;
    border: 2px solid var(--auth-gray-200);
    border-radius: var(--auth-border-radius);
    font-size: 0.95rem;
    transition: var(--auth-transition);
    background: var(--auth-white);
    position: relative;
    z-index: 10;
    pointer-events: auto;
    cursor: text;
}

.input-wrapper input:focus,
.input-wrapper select:focus {
    outline: none;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(75, 56, 47, 0.1);
}

.input-wrapper input:focus + i,
.input-wrapper select:focus + i {
    color: var(--auth-primary);
}

.password-toggle {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--auth-gray-400);
    cursor: pointer;
    z-index: 2;
    padding: 0.25rem;
    transition: var(--auth-transition);
}

.password-toggle:hover {
    color: var(--auth-primary);
}

/* ===== FORM OPTIONS ===== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.remember-me {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--auth-gray-600);
}

.remember-me input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--auth-gray-300);
    border-radius: 3px;
    margin-right: 0.5rem;
    position: relative;
    transition: var(--auth-transition);
}

.remember-me input:checked + .checkmark {
    background: var(--auth-primary);
    border-color: var(--auth-primary);
}

.remember-me input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.forgot-password {
    color: var(--auth-primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--auth-transition);
}

.forgot-password:hover {
    color: var(--auth-primary-light);
    text-decoration: underline;
}

/* ===== AUTH BUTTONS ===== */
.auth-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--auth-border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--auth-transition);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-btn.primary {
    background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-accent) 100%);
    color: var(--auth-white);
    box-shadow: var(--auth-shadow);
    border: 1px solid var(--auth-accent);
}

.auth-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--auth-shadow-lg);
}

.auth-btn.primary:active {
    transform: translateY(0);
}

.btn-loader {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

.auth-btn.loading .btn-text {
    opacity: 0;
}

.auth-btn.loading .btn-loader {
    display: block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== SOCIAL LOGIN ===== */
.social-login {
    margin-top: 2rem;
}

.divider {
    text-align: center;
    position: relative;
    margin: 1.5rem 0;
    color: var(--auth-gray-500);
    font-size: 0.9rem;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--auth-gray-200);
    z-index: 1;
}

.divider span {
    background: var(--auth-white);
    padding: 0 1rem;
    position: relative;
    z-index: 2;
}

.social-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.social-btn {
    padding: 0.75rem 1rem;
    border: 2px solid var(--auth-gray-200);
    border-radius: var(--auth-border-radius);
    background: var(--auth-white);
    color: var(--auth-gray-700);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--auth-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--auth-shadow);
}

.social-btn.google:hover {
    border-color: #db4437;
    color: #db4437;
    background: rgba(219, 68, 55, 0.05);
}

.social-btn.facebook:hover {
    border-color: #3b5998;
    color: #3b5998;
    background: rgba(59, 89, 152, 0.05);
}

.social-btn i {
    font-size: 1.1rem;
}

/* ===== PASSWORD STRENGTH ===== */
.password-strength {
    margin-top: 0.5rem;
}

.strength-bar {
    width: 100%;
    height: 4px;
    background: var(--auth-gray-200);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: var(--auth-transition);
    border-radius: 2px;
}

.strength-fill.weak {
    width: 25%;
    background: var(--auth-danger);
}

.strength-fill.fair {
    width: 50%;
    background: var(--auth-warning);
}

.strength-fill.good {
    width: 75%;
    background: var(--auth-info);
}

.strength-fill.strong {
    width: 100%;
    background: var(--auth-success);
}

.strength-text {
    font-size: 0.8rem;
    color: var(--auth-gray-500);
}

/* ===== TERMS CHECKBOX ===== */
.terms-checkbox {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--auth-gray-700);
    line-height: 1.4;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(75, 56, 47, 0.03);
    border-radius: var(--auth-border-radius);
    border: 1px solid var(--auth-gray-200);
    transition: var(--auth-transition);
}

.terms-checkbox:hover {
    background: rgba(75, 56, 47, 0.05);
    border-color: var(--auth-primary);
}

.terms-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 0.75rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--auth-primary);
}

.terms-checkbox a {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 500;
}

.terms-checkbox a:hover {
    text-decoration: underline;
    color: var(--auth-primary-light);
}


/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .login-register-container {
        padding: 1rem;
    }
    
    .auth-card {
        border-radius: var(--auth-border-radius);
    }
    
    .auth-header {
        padding: 2rem 1.5rem 1.5rem;
    }
    
    .auth-form {
        padding: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .social-buttons {
        grid-template-columns: 1fr;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .auth-header {
        padding: 1.5rem 1rem 1rem;
    }
    
    .auth-logo .logo-text {
        font-size: 1.5rem;
    }
    
    .auth-form {
        padding: 1rem;
    }
    
    .auth-tab {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .auth-tab span {
        display: none;
    }
}

/* ===== LOADING STATES ===== */
.auth-form.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* ===== ERROR STATES ===== */
.form-group.error input,
.form-group.error select {
    border-color: var(--auth-danger);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-group.error .error-message {
    color: var(--auth-danger);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
}

/* ===== SUCCESS STATES ===== */
.form-group.success input,
.form-group.success select {
    border-color: var(--auth-success);
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* ===== AUTH MESSAGES ===== */
.auth-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: var(--auth-border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

.auth-message-success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--auth-success);
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.auth-message-error {
    background: rgba(220, 53, 69, 0.1);
    color: var(--auth-danger);
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.auth-message-info {
    background: rgba(23, 162, 184, 0.1);
    color: var(--auth-info);
    border: 1px solid rgba(23, 162, 184, 0.2);
}

.auth-message i {
    font-size: 1.1rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms;
        animation-iteration-count: 1;
        transition-duration: 0.01ms;
    }
}

/* Focus styles for keyboard navigation */
.auth-tab:focus,
.auth-btn:focus,
.social-btn:focus,
.input-wrapper input:focus,
.input-wrapper select:focus {
    outline: 2px solid var(--auth-primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .auth-card {
        border: 2px solid var(--auth-dark);
    }
    
    .input-wrapper input,
    .input-wrapper select {
        border-width: 2px;
    }
}
