/* =====================================================
   CSS REFINADO - LOGIN - PAPO REDAÇÃO
   Design alinhado, elegante e profissional
   ===================================================== */

/* =====================================================
   VARIÁVEIS CSS E DESIGN TOKENS
   ===================================================== */
:root {
    /* Cores Primárias */
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --primary-lighter: #60a5fa;
    --secondary: #0ea5e9;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    
    /* Cores Neutras - Light Mode */
    --surface: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-light: #64748b;
    --border: #e2e8f0;
    --border-medium: #cbd5e1;
    
    /* Gradientes */
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #06b6d4 100%);
    --gradient-button: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    --gradient-bg: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
    
    /* Sombras Refinadas */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-primary: 0 4px 14px 0 rgba(37, 99, 235, 0.25);
    --shadow-primary-lg: 0 8px 24px 0 rgba(37, 99, 235, 0.35);
    
    /* Bordas Refinadas */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
    
    /* Transições Suaves */
    --transition-base: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =====================================================
   RESET E BASE
   ===================================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: var(--gradient-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =====================================================
   ELEMENTOS DE FUNDO
   ===================================================== */
.pattern-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: repeating-linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.03) 0px,
        transparent 1px,
        transparent 50px
    );
    z-index: 0;
}

.floating-shape {
    position: absolute;
    opacity: 0.08;
    animation: float 20s ease-in-out infinite;
    background: white;
    will-change: transform;
    z-index: 0;
}

.shape-1 {
    top: 10%;
    left: 10%;
    width: 100px;
    height: 100px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
}

.shape-2 {
    top: 60%;
    right: 15%;
    width: 150px;
    height: 150px;
    border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%;
    animation-delay: 5s;
}

.shape-3 {
    bottom: 20%;
    left: 20%;
    width: 80px;
    height: 80px;
    border-radius: 41% 59% 41% 59% / 59% 41% 59% 41%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(-20px, 20px) rotate(180deg);
    }
}

/* =====================================================
   CONTAINER PRINCIPAL
   ===================================================== */
.auth-container {
    width: 100%;
    max-width: 500px;
    background: var(--surface);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    overflow: hidden;
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* =====================================================
   CABEÇALHO
   ===================================================== */
.auth-header {
    background: var(--gradient-button);
    padding: 32px 40px 24px;
    text-align: center;
    position: relative;
}

.menu-toggle {
    display: none;
    position: absolute;
    top: 20px;
    left: 20px;
    background: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 8px;
    cursor: pointer;
    z-index: 1001;
    transition: var(--transition-base);
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.menu-toggle .icon-svg {
    width: 24px;
    height: 24px;
    filter: brightness(0) saturate(100%) invert(18%) sepia(95%) saturate(3018%) hue-rotate(211deg) brightness(93%) contrast(101%);
}

.register-link {
    position: absolute;
    top: 20px;
    right: 20px;
    color: var(--primary-dark);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    background: white;
    transition: var(--transition-base);
    letter-spacing: 0.02em;
}

.register-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--primary);
}

.register-link:active {
    transform: translateY(0);
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 0;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: var(--shadow-sm);
}

.logo-text {
    font-family: 'Poppins', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.02em;
}

/* =====================================================
   CONTEÚDO DO FORMULÁRIO
   ===================================================== */
.form-content {
    padding: 40px;
}

.page-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 32px;
}

/* =====================================================
   BOTÕES SOCIAIS
   ===================================================== */
.social-login {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.social-btn {
    padding: 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: white;
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.social-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.social-btn:active {
    transform: translateY(0);
}

.social-btn img,
.social-btn svg {
    width: 20px;
    height: 20px;
}

.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-light);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* =====================================================
   INPUTS
   ===================================================== */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
}

.form-group input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-family: 'Inter', sans-serif;
    transition: var(--transition-base);
    background: white;
    color: var(--text-primary);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-group input::placeholder {
    color: var(--text-light);
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 18px;
    pointer-events: none;
    transition: color 0.3s ease;
}

.form-group input:focus ~ .input-icon {
    color: var(--primary);
}

.input-icon img.icon-svg {
    width: 18px;
    height: 18px;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 18px;
    transition: color 0.3s ease;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: var(--primary);
}

.password-toggle img.icon-svg {
    width: 18px;
    height: 18px;
}

/* =====================================================
   LINKS AUXILIARES
   ===================================================== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.remember-me input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.remember-me span {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    user-select: none;
}

.forgot-password {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-base);
}

.forgot-password:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

/* =====================================================
   BOTÃO PRINCIPAL
   ===================================================== */
.btn-primary {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--gradient-button);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-base);
    box-shadow: var(--shadow-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-family: 'Inter', sans-serif;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    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);
    }
}

.btn-text {
    display: inline-block;
}

/* =====================================================
   ÍCONES SVG
   ===================================================== */
.icon-svg {
    width: 1em;
    height: 1em;
    vertical-align: middle;
    display: inline-block;
}

/* =====================================================
   RESPONSIVIDADE COMPLETA
   ===================================================== */

/* Tablets grandes e iPads (1024px+) */
@media (min-width: 1024px) {
    .auth-container {
        max-width: 500px;
    }
}

/* Tablets pequenos (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .auth-container {
        max-width: 480px;
    }
    
    .form-content {
        padding: 32px;
    }
}

/* Telefones grandes (414px - 767px) */
@media (min-width: 414px) and (max-width: 767px) {
    body {
        padding: 16px;
    }

    .auth-container {
        max-width: 100%;
        border-radius: var(--radius-lg);
    }

    .form-content {
        padding: 28px;
    }
}

/* Telefones médios e pequenos (até 600px) */
@media (max-width: 600px) {
    body {
        padding: 0;
    }

    .auth-container {
        max-width: 100%;
        border-radius: 0;
        min-height: 100vh;
        min-height: -webkit-fill-available;
        display: flex;
        flex-direction: column;
        padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    }

    .auth-header {
        padding: 20px 16px;
        padding-top: calc(20px + env(safe-area-inset-top, 0px));
    }

    .menu-toggle {
        display: flex;
        top: 20px;
        left: 16px;
    }

    .register-link {
        position: relative;
        top: auto;
        right: auto;
        display: inline-block;
        margin-top: 16px;
        width: calc(100% - 32px);
        text-align: center;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .form-content {
        padding: 24px 16px;
        padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .social-login {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .social-btn {
        min-height: 48px;
        font-size: 0.9375rem;
    }

    .page-title {
        font-size: 1.375rem;
    }

    .page-subtitle {
        font-size: 0.9375rem;
    }

    .btn-primary {
        min-height: 48px;
        font-size: 1rem;
    }
}

/* Telefones muito pequenos (até 480px) */
@media (max-width: 480px) {
    .logo-text {
        font-size: 1.375rem;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .form-content {
        padding: 20px 12px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    }

    .page-title {
        font-size: 1.25rem;
    }

    .form-group {
        margin-bottom: 20px;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* Telefones extra pequenos (até 375px) */
@media (max-width: 375px) {
    .auth-header {
        padding: 16px 12px;
        padding-top: calc(16px + env(safe-area-inset-top, 0px));
    }

    .form-content {
        padding: 16px 12px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }

    .page-title {
        font-size: 1.125rem;
    }
}

/* Orientação landscape em mobile */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .auth-container {
        min-height: auto;
        max-height: 100vh;
    }

    .auth-header {
        padding: 12px 16px;
    }

    .form-content {
        padding: 16px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
    }

    .logo-text {
        font-size: 1.25rem;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
