/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #F2EFE9;
    --primary-dark: #E6E0D4;
    --primary-light: #F8F6F2;
    --primary-lighter: #FDFCFB;
    --secondary-color: #FAF8F5;
    --error-color: #ef4444;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --text-primary: #50463E;
    --text-secondary: #7A6F65;
    --bg-white: #FFFFFF;
    --bg-light: #FAFAFA;
    --border-light: #E2E8F0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-light);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

/* Container */
.container {
    display: flex;
    width: 90%;
    max-width: 1200px;
    background: var(--bg-white);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* Forms Container */
.forms-container {
    flex: 1;
    padding: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-wrapper {
    width: 100%;
    max-width: 400px;
}

/* Auth Forms */
.auth-form {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.auth-form.active {
    display: block;
}

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

.form-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-subtitle {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* Form Groups */
.form-group {
    position: relative;
    margin-bottom: 24px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(242, 239, 233, 0.3);
}

.form-label {
    position: absolute;
    left: 16px;
    top: 14px;
    font-size: 16px;
    color: var(--text-secondary);
    background: white;
    padding: 0 4px;
    transition: all 0.3s ease;
    pointer-events: none;
}

.form-input:focus ~ .form-label,
.form-input:not(:placeholder-shown) ~ .form-label {
    top: -10px;
    left: 12px;
    font-size: 12px;
    color: var(--primary-color);
}

.password-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

.checkbox-label input {
    margin-right: 8px;
}

.forgot-password {
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    color: white;
    background: linear-gradient(135deg, #50463E 0%, #3A322C 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(242, 239, 233, 0.6);
}

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

.submit-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.submit-btn:active::after {
    width: 300px;
    height: 300px;
}

/* Form Footer */
.form-footer {
    text-align: center;
    margin-top: 24px;
}

.form-footer p {
    font-size: 14px;
    color: var(--text-secondary);
}

.switch-form {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.switch-form:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* Side Panel */
.side-panel {
    flex: 1;
    background: linear-gradient(135deg, #50463E 0%, #3A322C 100%);
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: white;
    border-radius: 0 20px 20px 0;
    position: relative;
    overflow: hidden;
}

.side-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    transform: rotate(45deg);
}

.brand {
    text-align: center;
}

.logo {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -2px;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.9;
}

.powered-by {
    font-size: 0.4em;
    font-weight: 400;
    opacity: 0.8;
    vertical-align: middle;
    letter-spacing: 0.01em;
}

.t54-logo {
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.25em;
    height: 1.2em;
    width: auto;
    opacity: 0.9;
}

/* Make t54 logo white on dark background */
.side-panel .t54-logo {
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

/* Features */
.features {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.feature {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    text-align: left;
}

.feature-icon {
    font-size: 2rem;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    transition: background 0.3s ease;
}

.feature:hover .feature-icon {
    background: rgba(255, 255, 255, 0.3);
}

.feature-content {
    flex: 1;
}

.feature h3 {
    font-size: 1.125rem;
    margin: 0 0 0.25rem 0;
    font-weight: 600;
}

.feature p {
    font-size: 0.875rem;
    opacity: 0.9;
    line-height: 1.5;
    margin: 0;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
}

.toast {
    background: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--error-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

.toast-icon {
    font-size: 1.2rem;
}

.toast-message {
    flex: 1;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 968px) {
    .container {
        flex-direction: column;
        height: auto;
        max-width: 500px;
    }
    
    .side-panel {
        border-radius: 20px 20px 0 0;
        padding: 40px;
    }
    
    .forms-container {
        padding: 40px;
    }
    
    .features {
        gap: 16px;
    }
    
    .feature-icon {
        width: 40px;
        height: 40px;
    }
    
    .feature h3 {
        font-size: 1rem;
    }
    
    .feature p {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .forms-container {
        padding: 30px 20px;
    }
    
    .side-panel {
        padding: 30px 20px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}
