/* Finance - Design Tokens e Estilos Customizados (Mobills Style) */

/* ============================================
   FONT FACES (Foundrs OS Custom Fonts)
   ============================================ */

/* FoundrsSans (Regular/Bold Variable) - Normal */
@font-face {
    font-family: 'FoundrsSans';
    src: url('media/202112071e5d7466-s.p.woff2') format('woff2');
    font-weight: 300 800;
    font-style: normal;
    font-display: swap;
}

/* FoundrsSans (Regular/Bold Variable) - Italic */
@font-face {
    font-family: 'FoundrsSans';
    src: url('media/73af0ef16113246e-s.p.woff2') format('woff2');
    font-weight: 300 800;
    font-style: italic;
    font-display: swap;
}

/* FoundrsSerif (Display Variable) - Normal */
@font-face {
    font-family: 'FoundrsSerif';
    src: url('media/18f7e26d8fc3ca09-s.p.woff2') format('woff2');
    font-weight: 300 800;
    font-style: normal;
    font-display: swap;
}

/* FoundrsSerif (Display Variable) - Italic */
@font-face {
    font-family: 'FoundrsSerif';
    src: url('media/54e05bce7a25fe9c-s.p.woff2') format('woff2');
    font-weight: 300 800;
    font-style: italic;
    font-display: swap;
}

:root {
    /* Cores da Marca */
    --primary: #C47CFF;
    --accent-aqua: #A5F3FC;
    --accent-star: #FF4A3A;
    --ink: #0B2534;
    --ink-soft: #123349;

    /* Base */
    --bg-page: #F5F5F7;
    --bg-card: #FFFFFF;
    --border-subtle: #E2E8F0;
    --text-main: #0B2534;
    --text-muted: #6B7280;
    --shape-dark: #020617;
    --focus-ring: #C47CFF;

    /* Legado (Mapeamento para manter compatibilidade) */
    --primary-dark: #123349; /* Mapeado para Ink Soft */
    --primary-light: #C47CFF;
    --accent-lime: #A5F3FC; /* Mapeado para Aqua */
    --accent-dark-purple: #020617; /* Mapeado para Shape Dark */

    /* Cores Semânticas */
    --positive: #4CAF50;
    --negative: #F44336;
    --info-blue: #2196F3;
    --info-teal: #00796B;
    --warning: #FFC107;
    --text-on-primary: #FFFFFF;

    /* Dimensões */
    --sidebar-width: 260px;
    --sidebar-width-collapsed: 88px;
    --topbar-height: 70px;
    --border-radius-lg: 25px;
    --border-radius-md: 16px;
    --border-radius-sm: 8px;
    --border-radius-pill: 50px;

    /* Sombras */
    --shadow-card: 0 2px 1px -1px rgba(0,0,0,0.2), 0 1px 1px 0 rgba(0,0,0,0.14), 0 1px 3px 0 rgba(0,0,0,0.12);
    --shadow-fab: 0 3px 5px -1px rgba(0,0,0,.2), 0 6px 10px 0 rgba(0,0,0,.14), 0 1px 18px 0 rgba(0,0,0,.12);

    /* Fontes */
    --font-body: "FoundrsSans", "FoundrsSans Fallback", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-display: "FoundrsSerif", "FoundrsSerif Fallback", "Georgia", "Times New Roman", serif;
}

/* Reset e Base */
body {
    font-family: var(--font-body);
    background-color: var(--bg-page);
    color: var(--text-main);
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 500;
    color: var(--text-main);
}

/* ============================================
   LAYOUT E SIDEBAR
   ============================================ */

.finance-layout {
    min-height: 100vh;
}

/* Sidebar Container */
.sidebar-container {
    width: var(--sidebar-width);
    background-color: var(--bg-card);
    border-right: none; /* Clean look */
    position: fixed;
    top: var(--topbar-height);
    bottom: 0;
    left: 0;
    z-index: 1000;
    transition: width 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    overflow: visible;
}

/* Estado Colapsado (Desktop) */
.finance-layout.sidebar-closed .sidebar-container {
    width: var(--sidebar-width-collapsed);
}

/* Conteúdo Principal */
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height); /* Compensar header fixo */
    transition: margin-left 0.3s ease;
}

.finance-layout.sidebar-closed .main-container {
    margin-left: var(--sidebar-width-collapsed);
}

.finance-layout.sidebar-hidden .main-container {
    margin-left: 0;
}

.body-content {
    padding: 24px 32px;
    flex: 1;
}

.content-wrapper {
    max-width: 1440px;
    margin: 0 auto;
}

/* Header/Topbar - Fixed to preserve original behavior */
.header-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    z-index: 1000;
    background: var(--bg-card); /* Manter fundo branco/card */
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between; /* Separar esquerda e direita */
    padding: 0 32px;
}

.topbar {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Organization Selector */
.org-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-page);
    padding: 8px 16px;
    border-radius: 50px;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.2s;
    border: 1px solid transparent;
}

.org-selector:hover {
    background-color: #E1E8F5; /* Slightly darker than bg-page */
    color: var(--primary);
}

.org-icon {
    color: var(--primary);
    font-size: 20px;
}

.org-name {
    font-weight: 600;
    font-size: 0.9rem;
    font-family: var(--font-display);
    color: var(--text-main);
}

.arrow-icon {
    color: var(--text-muted);
    font-size: 20px;
}

/* Theme Toggle */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background-color: var(--bg-page);
    color: var(--primary);
}

/* ============================================
   USER SECTION (Mobills Style)
   ============================================ */

.user-section {
    position: relative;
}

.user-btn {
    background: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.user-btn:hover {
    background-color: rgba(0,0,0,0.04);
}

.user-avatar-container {
    position: relative;
    width: 40px;
    height: 40px;
}

.user-avatar-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #BDBDBD; /* Default grey */
    color: #FFF;
    display: grid;
    place-items: center;
    font-weight: 500;
    font-size: 1rem;
    font-family: var(--font-body);
}

/* O avatar real pode ser uma imagem, mas o padrao e cor solida/iniciais */
.user-avatar-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-name-text {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-main);
    white-space: nowrap;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-chevron {
    color: var(--text-muted);
    font-size: 20px;
}

/* Dropdown Menu (MuiPaper mimic) */
.user-dropdown-menu {
    position: absolute;
    top: 50px; /* Below header */
    right: 0;
    width: 280px;
    background: #FFF;
    border-radius: 4px; /* Mui uses smaller radius for menus usually */
    box-shadow: 0px 5px 5px -3px rgba(0,0,0,0.2), 0px 8px 10px 1px rgba(0,0,0,0.14), 0px 3px 14px 2px rgba(0,0,0,0.12); /* Elevation 8 */
    padding: 8px 0;
    z-index: 2000;
    display: none;
    transform-origin: top right;
    animation: scaleIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-dropdown-menu.open {
    display: block;
}

.dropdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dropdown-link {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 1rem;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.dropdown-link:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.dropdown-icon {
    min-width: 36px;
    display: flex;
    align-items: center;
    color: var(--text-muted);
}

.dropdown-link .material-symbols-rounded {
    font-size: 24px;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Sidebar Components */
.finance-sidebar {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    position: relative;
}

.sidebar-toggle-handle {
    position: absolute;
    top: 10%;
    right: -16px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-card);
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: background 0.2s ease, color 0.2s ease, right 0.2s ease;
    z-index: 1200;
}

.sidebar-toggle-handle:hover {
    background: var(--primary);
    color: #fff;
}

.sidebar-toggle-handle .material-symbols-rounded {
    font-size: 20px;
}

.finance-layout.sidebar-closed .sidebar-toggle-handle {
    right: -14px;
}

.sidebar-header {
    padding: 0 24px;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Alinhado à esquerda */
    height: 48px;
}

.sidebar-logo {
    min-width: 40px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #FFF;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
}

.sidebar-title {
    margin-left: 12px;
    transition: opacity 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}

.finance-layout.sidebar-closed .sidebar-title {
    opacity: 0;
    transform: translateX(-10px);
    pointer-events: none;
    display: none;
}

.sidebar-nav {
    flex: 1;
    padding: 0 16px;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 12px;
    padding-left: 16px;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.finance-layout.sidebar-closed .nav-section-title {
    opacity: 0;
    height: 0;
    margin: 0;
    overflow: hidden;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 50px; /* Pill shape total no hover se expandido, circular se colapsado? Vamos usar radius fixo grande */
    transition: all 0.2s ease;
    margin-bottom: 8px;
    height: 48px;
}

.nav-link:hover {
    background-color: rgba(101, 21, 221, 0.05);
    color: var(--primary);
}

.nav-link.active {
    background-color: rgba(101, 21, 221, 0.1);
    color: var(--primary);
    font-weight: 600;
}

/* Icon Container (Circle) */
.nav-icon-pill {
    min-width: 40px; /* Fixo */
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background-color: #F3E5F5; /* Roxo bem clarinho padrão */
    color: var(--primary);
    transition: all 0.2s;
}

.nav-link:hover .nav-icon-pill {
    background-color: var(--primary);
    color: #FFF;
    box-shadow: 0 4px 10px rgba(101, 21, 221, 0.3);
}

.nav-link.active .nav-icon-pill {
    background-color: var(--primary);
    color: #FFF;
    box-shadow: 0 4px 10px rgba(101, 21, 221, 0.4);
}

.nav-text {
    margin-left: 16px;
    white-space: nowrap;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: opacity 0.2s;
}

.finance-layout.sidebar-closed .nav-text {
    display: none;
}

.finance-layout.sidebar-closed .nav-link {
    justify-content: center;
    padding: 12px 0;
}

.nav-divider {
    height: 1px;
    background-color: rgba(0,0,0,0.05);
    margin: 16px 16px;
}

/* Logout/Footer */
.logout-form {
    margin-top: auto;
}

.logout-btn {
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

/* ============================================
   CARDS & UI COMPONENTS
   ============================================ */

/* Card Padrão */
.finance-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    border: none;
    position: relative;
}

/* Resumo Card (Saldo/Receita...) */
.card-resumo {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-card);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 100px;
}

.card-resumo__content {
    display: flex;
    flex-direction: column;
}

.card-resumo__title {
    font-family: var(--font-display);
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-resumo__value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-main);
}

.card-resumo__icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #FFF;
    /* Cores devem ser definidas por classes utilitárias ou inline */
}

.icon-bg-blue { background-color: var(--info-blue); }
.icon-bg-green { background-color: var(--positive); }
.icon-bg-red { background-color: var(--negative); }
.icon-bg-teal { background-color: var(--info-teal); }
.icon-bg-purple { background-color: var(--primary); }

/* Botões */
.btn {
    border-radius: 50px; /* Pill shape */
    padding: 10px 24px;
    font-family: var(--font-display);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary);
    color: #FFF;
    box-shadow: 0 4px 6px rgba(101, 21, 221, 0.25);
    border: none;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 6px 12px rgba(101, 21, 221, 0.35);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: rgba(101, 21, 221, 0.05);
}

/* Icon Button */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background-color: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--primary);
}

.btn-icon:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon .material-symbols-rounded {
    font-size: 20px;
}

.btn-icon.danger:hover {
    color: var(--negative);
    background-color: rgba(244, 67, 54, 0.1);
}

/* Tabela Customizada */
.finance-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.finance-table th {
    text-align: left;
    padding: 16px 24px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.finance-table td {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(0,0,0,0.03);
    vertical-align: middle;
    font-size: 0.95rem;
}

.finance-table tr:last-child td {
    border-bottom: none;
}

/* Responsividade Mobile */
@media (max-width: 1024px) {
    .finance-layout.sidebar-closed .sidebar-container {
        transform: translateX(-100%); /* Esconde totalmente no mobile se fechado */
        width: var(--sidebar-width); /* Mantém largura full se aberto */
    }
    
    .sidebar-container {
        transform: translateX(-100%);
    }
    
    .finance-layout.sidebar-open .sidebar-container {
        transform: translateX(0);
    }

    .main-container {
        margin-left: 0 !important; /* Remove margem no mobile */
    }

    .sidebar-backdrop {
        display: block; /* Ativa backdrop no mobile */
    }
}

/* Utilitários de Texto */
.text-success { color: var(--positive) !important; }
.text-danger { color: var(--negative) !important; }
.text-primary { color: var(--primary) !important; }
.font-display { font-family: var(--font-display); }

/* Form Controls Update */
.form-control {
    border-radius: var(--border-radius-lg);
    padding: 12px 20px;
    border: 1px solid #E0E0E0;
    background: #FFF;
}
.form-control:focus {
    background: #FFF;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(101, 21, 221, 0.1);
}

/* Material Icons Fix */
.material-symbols-rounded {
  font-variation-settings:
  'FILL' 1,
  'wght' 400,
  'GRAD' 0,
  'opsz' 24;
  font-size: 24px;
  line-height: 1;
}

/* ============================================
   Auth Experience
   ============================================ */

.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    background: var(--bg-page);
    position: relative;
}

.hero-panel {
    position: relative;
    background:
        radial-gradient(circle at 20% 20%, rgba(139, 77, 237, 0.25), transparent 60%),
        radial-gradient(circle at 80% 30%, rgba(181, 224, 115, 0.12), transparent 55%),
        linear-gradient(135deg, var(--accent-dark-purple) 0%, var(--primary-dark) 55%, var(--primary) 100%);
    color: #fff;
    padding: 72px 96px;
    overflow: hidden;
}

.hero-panel::before,
.hero-panel::after {
    content: "";
    position: absolute;
    inset: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    transform: rotate(-4deg);
}

.hero-panel::after {
    inset: 40px;
    transform: rotate(6deg);
}

.hero-panel__content {
    position: relative;
    z-index: 1;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    gap: 36px;
}

.hero-panel__brand {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-panel__logo {
    font-weight: 700;
}

.hero-panel__badge {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.hero-panel__eyebrow {
    color: var(--primary-light);
    margin: 0 0 8px;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
}

.hero-panel__headline h1 {
    margin: 0;
    font-size: 2.6rem;
    line-height: 1.2;
    color: #FFFFFF;
}

.hero-panel__description {
    margin: 12px 0 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    line-height: 1.5;
}

.hero-panel__highlights {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.hero-chip {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
}

.hero-panel__cta {
    align-self: flex-start;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    border-radius: 999px;
    padding: 14px 32px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.hero-panel__cta:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.1);
}

.form-panel {
    background: var(--bg-page);
    padding: 60px 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 32px;
    min-height: 100vh;
}

.form-panel__top,
.auth-card,
.form-panel__footer {
    width: 100%;
    max-width: 440px;
}

.form-panel__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.pill-link {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    padding: 8px 16px;
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    transition: background 0.2s ease;
}

.pill-link:hover {
    background: rgba(101, 21, 221, 0.08);
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-card);
    width: 100%;
    max-width: 440px;
    position: relative;
}

.auth-card__header {
    margin-bottom: 32px;
}

.auth-card__header h2 {
    font-size: 1.75rem;
    margin: 0 0 8px;
}

.auth-card__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    margin: 0 0 12px;
    color: var(--primary);
    font-weight: 600;
}

.auth-card__subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.auth-alert {
    border-radius: var(--border-radius-sm);
    padding: 12px 16px;
    font-size: 0.9rem;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-alert--error {
    background-color: rgba(244, 67, 54, 0.1);
    color: var(--negative);
    border: 1px solid rgba(244, 67, 54, 0.2);
}

.auth-alert--success {
    background-color: rgba(76, 175, 80, 0.1);
    color: var(--positive);
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Mapping to standard classes is preferred, but keeping these for legacy/transitions */
.auth-field label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-main);
}

.auth-input {
    width: 100%;
    border-radius: var(--border-radius-lg);
    border: 1px solid #E0E0E0;
    background: #F9F9F9;
    padding: 12px 20px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: var(--font-body);
}

.auth-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(101, 21, 221, 0.1);
    background: #FFF;
}

.auth-field__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.muted-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.muted-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.auth-field--row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-direction: row;
}

.auth-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.auth-checkbox__label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0 !important;
}

/* Replacing .primary-btn with standard .btn-primary style */
.primary-btn {
    border: none;
    border-radius: 50px;
    padding: 14px;
    background-color: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.primary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.primary-btn:not(:disabled):hover {
    transform: translateY(-1px);
    background-color: var(--primary-dark);
    box-shadow: 0 4px 10px rgba(101, 21, 221, 0.3);
}

.loading-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-top-color: #fff;
    animation: spin 1s linear infinite;
}

.ghost-btn {
    margin-top: 12px;
    border-radius: 50px;
    padding: 12px;
    text-align: center;
    border: 2px solid rgba(0,0,0,0.05);
    color: var(--text-muted);
    font-weight: 600;
    display: block;
    background: transparent;
    width: 100%;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    font-family: var(--font-display);
    text-transform: uppercase;
    font-size: 0.8rem;
}

.ghost-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(101, 21, 221, 0.05);
}

.form-panel__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.language-switch {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    background: transparent;
    padding: 6px 14px;
    cursor: pointer;
    color: inherit;
    font-family: var(--font-body);
}

.helper-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-top: 4px;
}

.field-validation {
    color: var(--negative);
    font-size: 0.8rem;
    margin-top: 4px;
    display: block;
}

.auth-disclaimer {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 4px 0 0;
    text-align: center;
}

.auth-providers {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-provider-btn {
    width: 100%;
    border-radius: var(--border-radius-lg);
    padding: 14px 20px;
    border: 1px solid #E0E0E0;
    background: #fff;
    color: var(--text-main);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
    font-family: var(--font-body);
}

.auth-provider-btn span {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
}

.auth-provider-btn:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(101, 21, 221, 0.1);
}

@media (max-width: 1024px) {
    .auth-page {
        grid-template-columns: 1fr;
    }

    .hero-panel {
        min-height: 300px;
        padding: 48px 32px;
        order: 2;
    }

    .form-panel {
        padding: 32px 24px 56px;
        min-height: auto;
        align-items: center;
        order: 1;
    }

    .form-panel__top {
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .hero-panel {
        padding: 32px 20px 56px;
    }

    .hero-panel__headline h1 {
        font-size: 2rem;
    }

    .hero-panel__description {
        font-size: 0.95rem;
    }

    .form-panel {
        padding: 24px 16px 48px;
    }

    .form-panel__top {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .auth-card {
        padding: 24px;
    }

    .auth-field--row {
        align-items: flex-start;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Organization Selector
   ============================================ */

.org-container {
    min-height: calc(100vh - var(--topbar-height, 70px));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: var(--bg-page);
}

.org-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-card);
    padding: 40px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(0,0,0,0.05);
}

.org-header {
    text-align: center;
    margin-bottom: 32px;
}

.org-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
    font-family: var(--font-display);
}

.org-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.organizations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.org-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #FFF;
}

.org-item:hover {
    border-color: var(--primary);
    background-color: rgba(101, 21, 221, 0.02);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.org-info h4 {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.org-role {
    display: inline-block;
    padding: 4px 12px;
    background-color: rgba(101, 21, 221, 0.08);
    color: var(--primary);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.org-arrow {
    color: var(--text-muted);
    transition: color 0.2s;
}

.org-item:hover .org-arrow {
    color: var(--primary);
}

.create-org-form {
    background-color: var(--bg-page);
    padding: 24px;
    border-radius: var(--border-radius-md);
    margin-bottom: 20px;
    border: 1px solid rgba(0,0,0,0.05);
}

.create-org-form h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-main);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 20px;
    opacity: 0.3;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.95rem;
}