/* ========================================
   LOGIN PAGE PREMIUM STYLES
   Inspired by PodPay Platform
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap');

:root {
    /* Default Dark Mode */
    --primary: #1395ec;
    --primary-hover: #0d84d4;
    --bg-page: #101b22;
    --bg-card: rgba(40, 50, 57, 0.6);
    --bg-brand: #0D6EBD;
    --input-bg: #283239;
    --text-main: #ffffff;
    --text-muted: #9daeb9;
    --border-color: rgba(255, 255, 255, 0.1);
    --font-family: 'Inter', sans-serif;
    --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] {
    --bg-page: #f3f4f6;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-brand: #1395ec;
    /* Azul mais vivo no light */
    --input-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: rgba(0, 0, 0, 0.1);
    --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-page);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* === THEME TOGGLE BUTTON === */
.theme-toggle {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 50;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* === BACKGROUND EFFECTS (Blobs) === */
.bg-blob {
    position: absolute;
    border-radius: 9999px;
    filter: blur(64px);
    /* blur-3xl eq ~64px */
    z-index: 0;
    opacity: 0.2;
    animation: pulse 4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

[data-theme="light"] .bg-blob {
    opacity: 0.15;
    /* Sutil no light */
}

.blob-1 {
    width: 24rem;
    height: 24rem;
    background-color: var(--primary);
    top: -25%;
    left: -25%;
}

.blob-2 {
    width: 24rem;
    height: 24rem;
    background-color: #8A2BE2;
    bottom: -25%;
    right: -25%;
    animation-delay: 500ms;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.2;
        transform: scale(1);
    }

    50% {
        opacity: 0.3;
        transform: scale(1.1);
    }
}

/* === MAIN CONTAINER === */
.login-container {
    width: 100%;
    max-width: 72rem;
    /* max-w-6xl */
    margin: 0 auto;
    position: relative;
    z-index: 10;
    padding: 1rem;
}

.login-grid {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 700px;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

@media (min-width: 768px) {
    .login-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* === LEFT SIDE (Branding) === */
.brand-section {
    background-color: var(--bg-brand);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
    position: relative;
}

.brand-content {
    max-width: 28rem;
    margin: 0 auto;
}

.brand-logo {
    font-size: 3.75rem;
    /* text-6xl */
    font-weight: 900;
    /* font-black */
    margin-bottom: 1.5rem;
    line-height: 1;
}

.brand-logo img {
    max-height: 80px;
    max-width: 100%;
    object-fit: contain;
}

.brand-desc {
    font-size: 1.25rem;
    /* text-xl */
    font-weight: 400;
    line-height: 1.625;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.brand-badges {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* === RIGHT SIDE (Form) === */
.form-section {
    background-color: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.form-content {
    width: 100%;
    max-width: 28rem;
    margin: 0 auto;
}

.form-header {
    margin-bottom: 2rem;
}

.form-header h2 {
    font-size: 1.875rem;
    /* text-3xl */
    font-weight: 900;
    line-height: 1.25;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.form-header p {
    color: var(--text-muted);
    font-size: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 1rem;
}

.input-label {
    color: var(--text-main);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    height: 3rem;
    /* h-12 */
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0 1rem;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    /* Simulando ring */
    box-shadow: 0 0 0 2px rgba(19, 149, 236, 0.3);
}

.forgot-link {
    display: flex;
    justify-content: flex-end;
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
}

.forgot-link a {
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
}

.forgot-link a:hover {
    text-decoration: underline;
}

.btn-primary {
    width: 100%;
    height: 3rem;
    background-color: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.register-section {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
}

.register-text {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.register-text a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    margin-left: 0.25rem;
}

.register-text a:hover {
    text-decoration: underline;
}

/* === MODERN TOAST NOTIFICATIONS === */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: rgba(30, 41, 59, 0.95);
    /* Dark Slate quase sólido */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    box-shadow: 0 15px 40px -10px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 320px;
    max-width: 400px;
    animation: toastSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.toast.success::before {
    background-color: #10B981;
    box-shadow: 0 0 12px #10B981;
}

.toast.error::before {
    background-color: #EF4444;
    box-shadow: 0 0 12px #EF4444;
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-icon .material-symbols-outlined {
    font-size: 28px;
}

.toast.success .toast-icon {
    color: #10B981;
}

.toast.error .toast-icon {
    color: #EF4444;
}

.toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.toast-message {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
    color: #f1f5f9;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform-origin: left;
    animation: toastProgress 3s linear forwards;
}

.toast.success .toast-progress {
    background: linear-gradient(90deg, #10B981, #34D399);
}

.toast.error .toast-progress {
    background: linear-gradient(90deg, #EF4444, #F87171);
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%) scale(0.9);
        opacity: 0;
    }

    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes toastProgress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

/* 2FA Input Group */
.otp-group {
    display: none;
    /* Hidden by default */
}

.otp-visible .login-group {
    display: none;
}

.otp-visible .otp-group {
    display: block;
}

@media (max-width: 768px) {
    .brand-section {
        padding: 2rem;
        border-radius: 1rem 1rem 0 0;
    }

    .form-section {
        border-radius: 0 0 1rem 1rem;
        padding: 2rem;
    }

    .brand-logo {
        font-size: 2.5rem;
    }
}

/* === 2FA PIN Style === */
.pin-inputs-container {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0 2rem;
}

.pin-input {
    width: 3rem;
    height: 3.5rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    transition: all 0.2s ease;
}

.pin-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(19, 149, 236, 0.3);
    transform: translateY(-2px);
}

.pin-input::-webkit-outer-spin-button,
.pin-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pin-input[type=number] {
    -moz-appearance: textfield;
}