@charset "utf-8";

/* ============================================
   DIVY - LOGIN STYLES
   Design Split-Screen Moderno
   ============================================ */

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --surface: #ffffff;
    --surface-hover: #f9fafb;
    --border: #e5e7eb;
    --border-focus: #3b82f6;
    --hero-bg: #0c1222;
    --hero-gradient-1: #1e3a5f;
    --hero-gradient-2: #0f172a;
    --radius: 10px;
    --radius-lg: 12px;
}

body {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    background: var(--surface);
}

/* ===== CONTAINER PRINCIPAL ===== */
.login-container {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ===== LADO ESQUERDO - HERO ===== */
.login-hero {
    flex: 1;
    background: linear-gradient(135deg, var(--hero-bg) 0%, var(--hero-gradient-1) 50%, var(--hero-gradient-2) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 540px;
}

/* Logo */
.hero-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 60px;
    color: white;
}

.hero-logo svg {
    width: 32px;
    height: 32px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.hero-logo span {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
}

/* Badge */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 32px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-badge svg {
    color: #fbbf24;
}

/* Título */
.hero-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 56px;
    font-weight: 500;
    color: white;
    line-height: 1.15;
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.hero-title span {
    font-style: italic;
    color: rgba(255, 255, 255, 0.85);
}

/* Descrição */
.hero-description {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    margin-bottom: 48px;
    max-width: 440px;
}

/* Features */
.hero-features {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.feature-tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.feature-tag svg {
    color: #60a5fa;
}

/* Background Effects */
.hero-bg-effects {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
}

.glow-1 {
    width: 400px;
    height: 400px;
    background: #3b82f6;
    top: -100px;
    left: -100px;
    animation: float 8s ease-in-out infinite;
}

.glow-2 {
    width: 300px;
    height: 300px;
    background: #06b6d4;
    bottom: -50px;
    right: -50px;
    animation: float 10s ease-in-out infinite reverse;
}

.glow-3 {
    width: 200px;
    height: 200px;
    background: #8b5cf6;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulse-glow 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 30px); }
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.5; transform: translate(-50%, -50%) scale(1.2); }
}

/* ===== LADO DIREITO - FORMULÁRIO ===== */
.login-form-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--surface);
}

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

/* Header do Form */
.form-header {
    margin-bottom: 32px;
}

.form-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

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

/* Botões OAuth */
.oauth-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.oauth-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.oauth-btn:hover {
    background: var(--surface-hover);
    border-color: #d1d5db;
}

.oauth-btn svg {
    flex-shrink: 0;
}

.github-btn svg {
    color: var(--text-primary);
}

/* Divisor */
.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.divider span {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Formulário */
#login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.forgot-password {
    font-size: 14px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* Input Wrapper */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.2s;
}

input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 14px 14px 14px 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: 15px;
    color: var(--text-primary);
    transition: all 0.2s ease;
    outline: none;
}

input[type="text"]:hover,
input[type="password"]:hover,
input[type="email"]:hover {
    border-color: #d1d5db;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-wrapper:focus-within .input-icon {
    color: var(--primary);
}

input::placeholder {
    color: var(--text-muted);
}

/* Toggle Password */
.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: var(--text-secondary);
}

.toggle-password svg {
    width: 18px;
    height: 18px;
}

/* Botão Submit */
.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    background: var(--primary);
    color: white;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    margin-top: 8px;
}

.btn-submit:hover {
    background: var(--primary-dark);
}

.btn-submit:active {
    transform: scale(0.98);
}

.btn-submit svg {
    transition: transform 0.2s;
}

.btn-submit:hover svg {
    transform: translateX(4px);
}

/* Loading State */
.btn-submit.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn-submit.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* Mensagem de Login */
#login-message {
    text-align: center;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    display: none;
}

#login-message.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    display: block;
}

#login-message.success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
    display: block;
}

/* Link Criar Conta */
.signup-link {
    text-align: center;
    margin-top: 32px;
    font-size: 14px;
    color: var(--text-secondary);
}

.signup-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.signup-link a:hover {
    text-decoration: underline;
}

/* ===== RESPONSIVO ===== */

/* Tablet */
@media (max-width: 1024px) {
    .login-hero {
        padding: 40px;
    }

    .hero-title {
        font-size: 44px;
    }

    .hero-description {
        font-size: 16px;
    }
}

/* Mobile - Esconde o Hero */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
    }

    .login-hero {
        display: none;
    }

    .login-form-section {
        flex: 1;
        padding: 24px;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .form-container {
        max-width: 100%;
    }

    .form-header {
        text-align: center;
        margin-bottom: 32px;
    }

    .form-header h2 {
        font-size: 24px;
    }

    /* Adicionar logo no mobile */
    .form-header::before {
        content: "DIVY";
        display: block;
        font-size: 28px;
        font-weight: 700;
        color: var(--primary);
        letter-spacing: 3px;
        margin-bottom: 32px;
    }

    .oauth-buttons {
        flex-direction: column;
    }

    .oauth-btn {
        justify-content: center;
    }

    input[type="text"],
    input[type="password"],
    input[type="email"] {
        font-size: 16px; /* Previne zoom no iOS */
    }
}

/* Mobile Pequeno */
@media (max-width: 380px) {
    .login-form-section {
        padding: 20px 16px;
    }

    .form-header h2 {
        font-size: 22px;
    }

    .btn-submit {
        padding: 16px 20px;
    }
}

/* Safe Area para dispositivos com notch */
@supports (padding-top: env(safe-area-inset-top)) {
    .login-form-section {
        padding-top: max(24px, env(safe-area-inset-top));
        padding-bottom: max(24px, env(safe-area-inset-bottom));
    }
}

/* OAuth button loading state */
.oauth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.oauth-btn.loading {
    position: relative;
    color: transparent;
}

.oauth-btn.loading svg {
    opacity: 0;
}

.oauth-btn.loading::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
