/* ============================================
   PROJETO REDE SOCIAL HÍBRIDA - AUTH CSS
   Fase: A1.2 - Autenticação Base
   Tema: Orkut Nostálgico + Moderno
   ============================================ */

/* 🎨 VARIÁVEIS CSS */
:root {
    --primary-color: #8B5CF6;
    --primary-hover: #7C3AED;
    --secondary-color: #06B6D4;
    --success-color: #10B981;
    --error-color: #EF4444;
    --warning-color: #F59E0B;
    
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    
    --border-color: #E5E7EB;
    --border-focus: var(--primary-color);
    
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-mono: 'Courier New', monospace;
    
    --radius: 12px;
    --radius-sm: 8px;
    --spacing: 1rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 📱 LAYOUT AUTH */
.auth-page {
    min-height: 100vh;
    background: var(--bg-gradient);
    font-family: var(--font-family);
    color: var(--text-primary);
    line-height: 1.6;
}

.auth-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/pattern.svg') repeat;
    opacity: 0.05;
    z-index: -1;
}

/* 🏠 HEADER */
.auth-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.auth-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing);
}

.logo a {
    text-decoration: none;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.logo a:hover {
    transform: scale(1.05);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.auth-nav .btn-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.1);
}

.auth-nav .btn-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* 🎪 MAIN CONTENT */
.auth-main {
    flex: 1;
    padding: 2rem 0;
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
}

.auth-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* Layout com info lateral (registro) */
.register-page .auth-wrapper {
    max-width: 600px;
}

/* 💳 AUTH CARD */
.auth-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: slideUp 0.6s ease-out;
}

.auth-card-wide {
    max-width: 600px;
    margin: 0 auto;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card-header {
    padding: 2rem 2rem 1rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(6, 182, 212, 0.1));
}

.auth-card-header h2 {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-card-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.auth-card-body {
    padding: 1rem 2rem 2rem;
}

.auth-card-footer {
    padding: 1.5rem 2rem;
    background: rgba(0, 0, 0, 0.02);
    text-align: center;
    border-top: 1px solid var(--border-color);
}

/* 🚨 ALERTS */
.alert {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    animation: fadeIn 0.3s ease-out;
}

.alert-error {
    background: #FEF2F2;
    color: #991B1B;
    border-color: var(--error-color);
}

.alert-success {
    background: #ECFDF5;
    color: #065F46;
    border-color: var(--success-color);
}

.alert h4 {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.alert ul {
    margin: 0;
    padding-left: 1.2rem;
}

.alert li {
    margin-bottom: 0.3rem;
}

/* ℹ️ DEMO INFO */
.demo-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.demo-info h4 {
    margin: 0 0 0.5rem;
    color: #1E40AF;
    font-size: 0.9rem;
}

.demo-info p {
    margin: 0.3rem 0;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #374151;
}

/* 📝 FORMS */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.register-form {
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group-inline {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    padding: 0.8rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
    background: white;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    transform: translateY(-1px);
}

.form-group input:invalid {
    border-color: var(--error-color);
}

.form-help {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* 🔐 PASSWORD WRAPPER */
.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: var(--transition);
}

.password-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
}

.password-strength {
    margin-top: 0.5rem;
}

.strength-bar {
    height: 4px;
    background: #E5E7EB;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.strength-fill {
    height: 100%;
    transition: var(--transition);
}

.password-match {
    margin-top: 0.5rem;
}

/* ✅ CHECKBOX */
.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.4;
}

.checkbox-wrapper input[type="checkbox"] {
    margin: 0;
    transform: scale(1.1);
}

.checkbox-text a {
    color: var(--primary-color);
    text-decoration: underline;
}

.checkbox-text a:hover {
    color: var(--primary-hover);
}

.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.forgot-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* 🔘 BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-full {
    width: 100%;
}

.btn-social {
    background: white;
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.btn-social:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.btn-social:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-google:hover:not(:disabled) {
    border-color: #EA4335;
    color: #EA4335;
}

.btn-facebook:hover:not(:disabled) {
    border-color: #4267B2;
    color: #4267B2;
}

/* 🎯 DIVIDER */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    text-align: center;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    padding: 0 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    background: var(--card-bg);
}

/* 🔗 SOCIAL LOGIN */
.social-login {
    display: flex;
    gap: 0.75rem;
}

.social-login .btn {
    flex: 1;
}

/* 📊 INFO SECTION */
.auth-info {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 2rem;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-info h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.feature-list li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stats-preview {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.stats-preview h4 {
    margin: 0 0 1rem;
    font-size: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    text-align: center;
}

.stat-item {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.stat-item strong {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

/* 🦶 FOOTER */
.auth-footer {
    background: rgba(0, 0, 0, 0.1);
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    padding: 1.5rem 0;
    font-size: 0.85rem;
}

.auth-footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing);
}

.auth-footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
    margin: 0 0.5rem;
}

.version-info {
    margin-top: 0.5rem;
    opacity: 0.7;
}

.security-info {
    color: #10B981;
    font-weight: 500;
}

/* 🎭 ANIMATIONS */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* 📱 RESPONSIVE */
@media (max-width: 768px) {
    .auth-wrapper {
        padding: 0 1rem;
        gap: 1.5rem;
    }
    
    .auth-card-header,
    .auth-card-body,
    .auth-card-footer {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .auth-card-header h2 {
        font-size: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .form-group-inline {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .social-login {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .auth-info {
        order: -1;
        padding: 1.5rem;
    }
    
    .logo a {
        font-size: 1.25rem;
    }
    
    .auth-nav .btn-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .auth-main {
        padding: 1rem 0;
    }
    
    .auth-card-header,
    .auth-card-body,
    .auth-card-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .auth-card-header {
        padding-top: 1.5rem;
    }
    
    .btn {
        padding: 0.9rem 1.25rem;
    }
    
    .demo-info {
        padding: 0.75rem;
    }
}

/* 🌙 DARK MODE PREP */
@media (prefers-color-scheme: dark) {
    :root {
        --card-bg: rgba(17, 24, 39, 0.95);
        --text-primary: #F9FAFB;
        --text-secondary: #D1D5DB;
        --text-muted: #9CA3AF;
        --border-color: #374151;
    }
    
    .demo-info {
        background: rgba(59, 130, 246, 0.2);
        color: #E5E7EB;
    }
    
    .demo-info h4 {
        color: #60A5FA;
    }
    
    .demo-info p {
        color: #D1D5DB;
    }
}

/* ✨ LOADING STATES */
.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner::before {
    content: '';
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 🎨 LINK STYLES */
.link-primary {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 600;
    transition: var(--transition);
}

.link-primary:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

/* 🚫 DISABLED STATES */
input:disabled,
textarea:disabled,
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ⚡ FOCUS STATES */
input:focus-visible,
textarea:focus-visible,
button:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}