/*
 * Color Patterns - Centralized CSS Custom Properties and Reusable Patterns
 *
 * All color variables and button variant patterns should be defined here
 * and used throughout the application using var(--variable-name) syntax.
 *
 * Usage example:
 *   background-color: var(--brand-gold);
 *   color: var(--brand-brown);
 */

:root {
  /* ============================
   * PRIMARY BRAND COLORS
   * ============================ */

  /* Gold - Primary brand color, used for positive actions and branding */
  --brand-gold: rgb(190, 158, 85);

  /* Gold light variants - for backgrounds and subtle highlights */
  --brand-gold-light: rgba(190, 158, 85, 0.08);
  --brand-gold-lighter: rgba(190, 158, 85, 0.12);

  /* Brown - Secondary brand color, used for text, accents, and branding */
  --brand-brown: rgb(91, 72, 56);
  
  
  /* ============================
   * FLOW BUTTON COLORS
   * ============================
   * Used for filled buttons that control user flow through the application.
   * These are the main action buttons in forms and dialogs.
   */

  /* Primary/Move Forward - Used for Continuar, Confirmar, Submit */
  --flow-button-primary: rgb(190, 158, 85);
  --flow-button-primary-hover: rgb(170, 140, 75);

  /* Secondary/Halt Flow - Used for Cancelar, Voltar */
  --flow-button-secondary: rgb(180, 180, 180);
  --flow-button-secondary-hover: rgb(160, 160, 160);

  /* Confirm Destructive - Used to confirm Delete, Remove (permanent actions) */
  --flow-button-confirm-destructive: rgb(220, 53, 69);
  --flow-button-confirm-destructive-hover: rgb(200, 35, 51);


  /* ============================
   * INITIATE DOMAIN ACTION BUTTON COLORS
   * ============================
   * Used for outlined buttons that initiate domain-specific actions
   * within a page (e.g., financial operations on accounts).
   */

  /* Initiate positive actions - Reforçar DP, Utilizar CCC, Aprovar */
  --initiate-domain-action-positive: rgb(76, 145, 80);

  /* Initiate caution actions - Mobilizar DP, Cancelar operation, Pendentes indicator */
  --initiate-domain-action-caution: rgb(180, 80, 80);

  /* Initiate neutral actions - Amortizar CCC, Detalhes */
  --initiate-domain-action-neutral: rgb(150, 150, 150);


  /* ============================
   * GREY SCALE
   * ============================ */

  /* Grey for borders, dividers, and subtle outlines */
  --grey-border: rgb(150, 150, 150);

  /* Grey for secondary/disabled text */
  --grey-text: rgb(150, 150, 150);

  /* Grey for button backgrounds (slightly lighter than border grey) */
  --grey-button: rgb(180, 180, 180);


  /* ============================
   * TRANSPARENT BUTTON COLORS
   * ============================
   * Used for outline/transparent buttons that are secondary actions.
   */

  /* Light variant - for use on dark/colored backgrounds */
  --transparent-button-light-border: white;
  --transparent-button-light-text: white;

  /* Neutral variant - for use on light backgrounds */
  --transparent-button-neutral-border: rgb(150, 150, 150);
  --transparent-button-neutral-text: rgb(150, 150, 150);

  /* Branded variant - for use when brand emphasis needed */
  --transparent-button-branded-border: rgb(91, 72, 56);
  --transparent-button-branded-text: rgb(91, 72, 56);


  /* ============================
   * FILLED ACTION BUTTON COLORS
   * ============================
   * Used for filled action buttons that don't fit flow control pattern.
   */

  /* Brand brown - primary action variant */
  --filled-action-button-brand-brown-bg: rgb(91, 72, 56);
  --filled-action-button-brand-brown-text: white;

  /* Brand gold - accent action variant */
  --filled-action-button-brand-gold-bg: rgb(190, 158, 85);
  --filled-action-button-brand-gold-text: white;

  /* White - for use on colored backgrounds (e.g., login) */
  --filled-action-button-white-bg: white;
  --filled-action-button-white-text: rgb(91, 72, 56);


  /* ============================
   * MODAL DISMISS BUTTON COLORS
   * ============================
   * Used for modal dismiss/acknowledge buttons.
   */

  --modal-dismiss-button-gradient: linear-gradient(135deg, rgb(91, 72, 56) 0%, rgb(75, 60, 48) 100%);
  --modal-dismiss-button-text: white;


  /* ============================
   * POPUP CHOICE BUTTON COLORS
   * ============================
   * Used for popup confirmation/decline buttons.
   */

  --popup-choice-confirm-bg: rgb(91, 72, 56);
  --popup-choice-confirm-text: white;
  --popup-choice-decline-bg: transparent;
  --popup-choice-decline-border: rgb(91, 72, 56);
  --popup-choice-decline-text: rgb(91, 72, 56);


  /* ============================
   * TEXT COLORS
   * ============================ */

  /* Primary text - main content, headings */
  --text-primary: rgb(60, 60, 60);

  /* Secondary text - labels, subtitles */
  --text-secondary: rgb(80, 80, 80);

  /* Tertiary text - descriptions, hints */
  --text-tertiary: rgb(100, 100, 100);

  /* Muted text - placeholder, disabled */
  --text-muted: rgb(120, 120, 120);

  /* Subtle text - very light, de-emphasized */
  --text-subtle: rgb(150, 150, 150);


  /* ============================
   * BACKGROUND COLORS
   * ============================ */

  /* Page background - main page bg */
  --bg-page: rgb(250, 250, 250);

  /* Card background - cards, panels */
  --bg-card: rgb(255, 255, 255);

  /* Alternate card background - for highlighted items */
  --bg-card-alt: rgb(248, 249, 250);

  /* Subtle background - very light sections */
  --bg-subtle: rgb(252, 253, 254);

  /* Warm background - cream/warm tinted */
  --bg-warm: rgb(255, 250, 240);

  /* Warm highlight background - golden tint */
  --bg-warm-highlight: rgb(255, 248, 235);

  /* Brand light background - light brown tint */
  --bg-brand-light: rgb(232, 223, 209);

  /* Brand gold light background - for selected items, highlights */
  --bg-brand-gold-light: rgba(190, 158, 85, 0.2);

  /* Input disabled background */
  --bg-input-disabled: rgb(245, 245, 245);


  /* ============================
   * BORDER COLORS
   * ============================ */

  /* Light border - very subtle */
  --border-light: rgb(240, 240, 240);

  /* Default border - normal borders */
  --border-default: rgb(230, 230, 230);

  /* Medium border - slightly stronger */
  --border-medium: rgb(220, 220, 220);

  /* Strong border - emphasis, hover */
  --border-strong: rgb(200, 200, 200);

  /* Dark border - high contrast */
  --border-dark: rgb(210, 210, 210);


  /* ============================
   * STATUS COLORS
   * ============================ */

  /* Success/positive - green tones */
  --status-success: rgb(73, 171, 73);
  --status-success-dark: rgb(87, 108, 68);
  --status-success-bg: rgb(209, 219, 197);

  /* Error/negative - red tones */
  --status-error: rgb(202, 70, 70);
  --status-error-dark: rgb(178, 51, 51);
  --status-error-bg: rgb(206, 196, 196);
  --status-error-light: rgb(255, 204, 204);

  /* Warning - caution actions */
  --status-warning: rgb(180, 80, 80);
  --status-warning-dark: rgb(125, 89, 89);

  /* Info - informational, links */
  --status-info: rgb(72, 137, 194);
  --status-link: rgb(0, 0, 238);

  /* Offline indicator - golden brown for cached/offline state */
  --status-offline: rgb(184, 134, 11);
  --status-offline-text: rgb(133, 100, 4);
  --status-offline-bg: rgba(255, 193, 7, 0.15);
  --status-offline-border: rgba(255, 193, 7, 0.3);

  /* Alert - urgent/immediate attention (bright red) */
  --status-alert: rgb(220, 30, 30);


  /* ============================
   * ACTION COLORS
   * ============================
   * Used for specific action icons and buttons.
   */

  /* Delete action - dark red */
  --action-delete: #880808;

  /* Confirm/check action - sage green */
  --action-confirm: #5F8575;


  /* ============================
   * BRAND VARIANTS
   * ============================ */

  /* Brand brown dark - darker variant */
  --brand-brown-dark: rgb(61, 42, 26);

  /* Brand gold dark - darker variant for cards */
  --brand-gold-dark: rgb(107, 93, 60);


  /* ============================
   * FINANCIAL INDICATOR COLORS
   * ============================ */

  /* Compra (buy) - red tone */
  --financial-compra: rgb(189, 57, 40);

  /* Venda (sell) - green tone */
  --financial-venda: rgb(54, 143, 68);


  /* ============================
   * REFERENCE STATUS COLORS
   * ============================ */

  /* Activo (active) - green */
  --referencia-activo: rgb(0, 150, 0);

  /* Utilizado (used) - blue */
  --referencia-utilizado: rgb(0, 0, 150);

  /* Cancelado/Expirado (cancelled/expired) - red */
  --referencia-cancelado: rgb(150, 0, 0);


  /* ============================
   * GRADIENT DEFINITIONS
   * ============================ */

  /* Brand gradient - Gold to Brown (used in login page, error pages) */
  --gradient-brand: linear-gradient(rgb(190, 158, 85), rgb(91, 72, 56));

  /* Gold gradient - for cards and highlights */
  --gradient-gold: linear-gradient(45deg, rgb(201, 167, 90), rgb(152, 130, 80));

  /* Brown gradient - for dark backgrounds */
  --gradient-brown: linear-gradient(135deg, rgb(91, 72, 56) 0%, rgb(75, 60, 45) 100%);

  /* DP card gradient - for deposit product cards */
  --gradient-dp-card: linear-gradient(to bottom, rgb(245, 240, 230), rgb(235, 230, 220));

  /* Brand brown RGB for shadows */
  --brand-brown-rgb: 91, 72, 56;
  /* Brand gold RGB for shadows */
  --brand-gold-rgb: 190, 158, 85;


  /* ============================
   * SPACING SCALE
   * ============================
   * Based on 4px base unit for consistent rhythm.
   * Use these throughout the app for margins, padding, gaps.
   */

  --space-2xs: 2px;     /* Micro spacing, inline elements */
  --space-xs: 4px;      /* Tight spacing, icons */
  --space-sm: 8px;      /* Small gaps, compact elements */
  --space-md: 16px;     /* Default spacing, form gaps */
  --space-lg: 24px;     /* Section spacing, card padding */
  --space-xl: 32px;     /* Large section gaps */
  --space-2xl: 40px;    /* Major section separations */
  --space-3xl: 60px;    /* Page-level spacing */
  --space-4xl: 80px;    /* Extra-large spacing */


  /* ============================
   * FORM LAYOUT SPACING
   * ============================
   * Semantic spacing tokens for consistent form layouts.
   * Use these for all form field and section spacing.
   */

  --form-field-gap: var(--space-xs);             /* 4px - Between label and input within a field */
  --form-field-spacing: var(--space-md);         /* 16px - Between fields within the same section */
  --form-section-spacing: var(--space-xl);       /* 32px - Between major form sections (e.g., Conta a debitar, Para quem) */
  --form-title-content-spacing: var(--space-sm); /* 8px - Between section title and first content element */
  --form-button-spacing: var(--space-2xl);       /* 40px - Above action buttons */
  --section-header-content-spacing: var(--space-lg); /* 24px - Between section header (e.g., entity name) and form content below */


  /* ============================
   * PAGE TITLE SPACING
   * ============================
   * Semantic spacing tokens for page title layout.
   * These control the spacing around page titles and subtitles.
   */

  --mobile-page-title-top-spacing: var(--space-lg);        /* 24px - Above page title on mobile (safe area after iPhone notch margin) */
  --mobile-page-title-content-spacing: var(--space-lg);   /* 24px - Between page title/subtitle and content on mobile */
  --desktop-page-title-content-spacing: var(--space-4xl); /* 80px - Between page title/subtitle and content on desktop */


  /* ============================
   * TYPOGRAPHY SCALE
   * ============================
   * Consistent font sizes across the app.
   * Prefer px over pt for better cross-browser consistency.
   *
   * USAGE GUIDELINES:
   * - --text-xs (12px): Only for fine print, timestamps, version numbers
   * - --text-sm (14px): Secondary info, badges, hints - NOT for primary content
   * - --text-base (15px): Default readable text, navigation, table content
   * - --text-md (16px): Emphasized content, card titles, buttons
   * - --text-lg+ : Headings only
   *
   * PREFER SEMANTIC TOKENS over raw scale values.
   * See semantic tokens section below for purpose-specific sizing.
   */

  --text-xs: 12px;      /* Fine print, captions */
  --text-sm: 14px;      /* Secondary text, subtle info */
  --text-base: 15px;    /* Body text, inputs */
  --text-md: 16px;      /* Emphasized body, buttons */
  --text-lg: 18px;      /* Subheadings */
  --text-xl: 20px;      /* Section titles */
  --text-2xl: 24px;     /* Page titles */
  --text-3xl: 30px;     /* Large display text */
  --text-4xl: 32px;     /* Extra large display, large icons */


  /* ============================
   * TYPOGRAPHY SEMANTIC TOKENS
   * ============================
   * Use these for consistent sizing by purpose.
   * These map to the base scale above for easy maintenance.
   * ALWAYS prefer these over raw --text-* values.
   */

  /* Page-level typography */
  --font-page-title: var(--text-2xl);           /* 24px - Main page titles */
  --font-section-title: var(--text-xl);         /* 20px - Major section headings */
  --font-section-subtitle: var(--text-lg);      /* 18px - Section subheadings, prompts */
  --font-subtitle: var(--text-lg);              /* 18px - General subtitle/emphasized text */

  /* Content typography */
  --font-card-title: var(--text-md);            /* 16px - Card/panel headings */
  --font-body: var(--text-base);                /* 15px - Main body text */
  --font-body-emphasis: var(--text-md);         /* 16px - Important body text */
  --font-label: var(--text-sm);                 /* 14px - Field labels */
  --font-caption: var(--text-xs);               /* 12px - Captions, hints */

  /* Navigation typography */
  --font-nav-item: var(--text-base);            /* 15px - Primary navigation items */
  --font-nav-item-sub: var(--text-sm);          /* 14px - Sub-navigation items */

  /* Tables & Lists typography */
  --font-table-header: var(--text-sm);          /* 14px - Table column headers */
  --font-table-cell: var(--text-base);          /* 15px - Table cell content */
  --font-list-item-title: var(--text-base);     /* 15px - List item primary text */
  --font-list-item-subtitle: var(--text-sm);    /* 14px - List item secondary text */

  /* Form elements typography */
  --font-field-title: var(--text-base);         /* 15px - Field labels/titles */
  --font-field-value: var(--text-base);         /* 15px - Field values */
  --font-field-hint: var(--text-sm);            /* 14px - Helper text, hints */

  /* Data display typography */
  --font-amount-large: var(--text-xl);          /* 20px - Large monetary amounts */
  --font-amount-medium: var(--text-lg);         /* 18px - Standard amounts */
  --font-amount-small: var(--text-md);          /* 16px - Compact list amounts */
  --font-currency: var(--text-sm);              /* 14px - Currency symbols */

  /* Interactive elements */
  --font-button: var(--text-md);                /* 16px - Button text */
  --font-link: var(--text-base);                /* 15px - Link text */
  --font-pinpad-digit: var(--text-3xl);         /* 30px - PIN pad digit buttons */


  /* ============================
   * BORDER RADIUS SCALE
   * ============================
   * Standardized corner rounding for visual consistency.
   */

  --radius-xs: 3px;     /* Subtle rounding, table cells */
  --radius-sm: 5px;     /* Inputs, small elements */
  --radius-md: 8px;     /* Cards, panels */
  --radius-lg: 12px;    /* Large cards, modals */
  --radius-xl: 16px;    /* Featured cards, hero elements */
  --radius-2xl: 20px;   /* Large rounded containers */
  --radius-full: 9999px; /* Pills, circular buttons */


  /* ============================
   * SHADOW SCALE
   * ============================
   * Consistent elevation system using brand colors.
   */

  /* Subtle shadow - for inputs, small elements */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);

  /* Light shadow - for cards at rest */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);

  /* Medium shadow - for elevated cards, dropdowns */
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);

  /* Large shadow - for modals, popovers */
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);

  /* Extra large shadow - for prominent modals */
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);

  /* Brand gold shadow - for selected/active gold elements */
  --shadow-brand-gold: 0 8px 24px rgba(190, 158, 85, 0.35);

  /* Brand brown shadow - for brand-colored elements */
  --shadow-brand-brown: 0 4px 20px rgba(91, 72, 56, 0.12);

  /* Card shadow - combined subtle shadow for cards */
  --shadow-card: 0 4px 20px rgba(91, 72, 56, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);

  /* Hover shadow - for interactive elements on hover */
  --shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.15);


  /* ============================
   * CARD BACKGROUNDS
   * ============================
   * Standardized card gradient backgrounds.
   */

  /* Standard card gradient - subtle white to off-white */
  --gradient-card: linear-gradient(145deg, #ffffff 0%, #fafafa 100%);

  /* Card border with brand tint */
  --border-card-brand: rgba(190, 158, 85, 0.15);


  /* ============================
   * TRANSITION TIMING
   * ============================
   * Standardized transition durations for consistent micro-interactions.
   * Use these throughout the app for hover effects, focus states, etc.
   */

  /* Fast - for subtle micro-interactions (hover states, focus rings) */
  --transition-fast: 0.15s ease;

  /* Normal - for standard transitions (cards, buttons, inputs) */
  --transition-normal: 0.2s ease;

  /* Slow - for larger/more dramatic transitions (modals, panels) */
  --transition-slow: 0.3s ease;

  /* Extra slow - for page transitions, complex animations */
  --transition-extra-slow: 0.5s ease;


  /* ============================
   * HOVER TRANSFORMS
   * ============================
   * Standardized hover lift effects for interactive elements.
   */

  /* Small lift - for compact elements (buttons, list items) */
  --hover-lift-sm: translateY(-1px);

  /* Medium lift - for cards, panels */
  --hover-lift-md: translateY(-2px);


  /* ============================
   * FOCUS RINGS
   * ============================
   * Standardized focus ring styles for accessibility.
   */

  /* Brand gold focus ring */
  --focus-ring-gold: 0 0 0 3px rgba(190, 158, 85, 0.25);

  /* Brand brown focus ring */
  --focus-ring-brown: 0 0 0 3px rgba(91, 72, 56, 0.2);


  /* ============================
   * LAYOUT CONSTANTS
   * ============================
   * Fixed layout dimensions for consistent positioning.
   * Used for centering modals and overlays on desktop.
   */

  /* Desktop side navigator width */
  --desktop-navigator-width: 300px;


  /* ============================
   * INPUT FIELD TOKENS
   * ============================
   * Standardized input field dimensions and styling.
   */

  /* Input heights - for consistent form field sizes */
  --input-height-sm: 36px;
  --input-height-md: 44px;
  --input-height-lg: 52px;

  /* Input padding */
  --input-padding-x: 12px;
  --input-padding-y: 10px;

  /* Input font size - slightly larger for better readability */
  --input-font-size: var(--text-base);

  /* Input border */
  --input-border-color: var(--grey-border);
  --input-border-color-focus: var(--brand-brown);
  --input-border-color-error: var(--status-error);

  /* Input focus ring */
  --input-focus-ring: var(--focus-ring-gold);
  --input-focus-ring-error: 0 0 0 3px rgba(202, 70, 70, 0.15);
}
/*
 * Layout Patterns - Centralized CSS for common layout utility classes
 *
 * This module provides reusable layout classes that were previously duplicated
 * across multiple page-specific CSS files.
 *
 * Usage:
 *   1. This file is imported globally in index.js
 *
 *   2. Import the layoutClasses object in your JS component:
 *      import { layoutClasses } from '@/styles/layoutPatterns';
 *
 *   3. Use the classes in your JSX:
 *      <div className={showSection ? '' : layoutClasses.hide}>...</div>
 *
 * Available classes:
 * - layout-hide: Hide an element (display: none !important)
 * - layout-desktopSection: Standard desktop section with top padding
 * - layout-containerSectionTitle: Flex container for section titles (centered)
 * - layout-sectionTitle: Standard section title styling
 */

/* ============================
 * VISIBILITY UTILITY
 * ============================ */

/*
 * Hide an element completely
 * Uses !important to ensure it overrides other display properties
 */
.layout-hide {
  display: none !important;
}


/* ============================
 * DESKTOP SECTION LAYOUT
 * ============================ */

/*
 * Standard desktop section container
 * Previously provided top padding for sections, but this is now
 * handled by --desktop-page-title-content-spacing in desktopPage.css
 */
.layout-desktopSection {
  /* padding-top removed - page title spacing now standardized via --desktop-page-title-content-spacing */
}


/* ============================
 * PAGE CONTENT WRAPPERS
 * ============================ */

/*
 * Standard page content column layout
 * Flexbox column with centered alignment, full width
 * Use for wrapping page content that needs flex column centering
 */
.layout-pageContentColumn {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/*
 * Desktop page content with top padding
 * Same as pageContentColumn but adds standard desktop top padding
 * Use for desktop page content that needs the 40px top gap
 */
.layout-desktopPageContentPadded {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding-top: 40px;
}


/* ============================
 * MOBILE SECTION TITLE
 * ============================ */

/*
 * Container for section titles (mobile)
 * Centers the title horizontally
 */
.layout-containerSectionTitle {
  display: flex;
  justify-content: center;
}

/*
 * Standard section title styling (mobile)
 * Uses brand brown color with bold weight
 */
.layout-sectionTitle {
  font-size: var(--font-card-title);
  color: var(--brand-brown);
  font-weight: bold;
  margin-bottom: var(--form-title-content-spacing);
}

/*
 * Desktop section title styling
 * Same as mobile but centered for desktop layouts
 */
.layout-desktopSectionTitle {
  font-size: var(--font-card-title);
  color: var(--brand-brown);
  font-weight: bold;
  text-align: center;
}


/* ============================
 * CARD UTILITY CLASSES
 * ============================
 * Reusable card styles for consistent panel/card appearance.
 * Use these instead of defining card styles in individual components.
 */

/*
 * Base card styling
 * Provides the standard card appearance with subtle gradient and shadow
 */
.layout-card {
  background: var(--gradient-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-card-brand);
  box-shadow: var(--shadow-card);
  box-sizing: border-box;
}

/*
 * Card with standard padding
 */
.layout-card-padded {
  padding: var(--space-lg);
}

/*
 * Card with extra padding for larger content
 */
.layout-card-padded-lg {
  padding: var(--space-lg) var(--space-xl);
}

/*
 * Elevated card variant - more prominent shadow
 */
.layout-card-elevated {
  box-shadow: var(--shadow-md);
}

/*
 * Interactive card - shows hover effect
 */
.layout-card-interactive {
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.layout-card-interactive:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}


/* ============================
 * FORM INPUT UTILITY CLASSES
 * ============================
 * Standardized form input styles for consistency across all pages.
 */

/*
 * Base text input styling
 * Uses input tokens for consistent sizing and focus states
 */
.layout-input {
  width: 100%;
  height: var(--input-height-md);
  padding: var(--input-padding-y) var(--input-padding-x);
  border: 1px solid var(--input-border-color);
  border-radius: var(--radius-sm);
  box-sizing: border-box;
  font-size: var(--input-font-size);
  color: var(--text-primary);
  background-color: var(--bg-card);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.layout-input::placeholder {
  color: var(--grey-text);
}

.layout-input:focus {
  border-color: var(--input-border-color-focus);
  box-shadow: var(--input-focus-ring);
}

/*
 * Disabled input state
 */
.layout-input-disabled {
  background-color: var(--bg-input-disabled);
  cursor: default;
  color: var(--text-muted);
}

/*
 * Error input state
 */
.layout-input-error {
  border-color: var(--input-border-color-error);
}

.layout-input-error:focus {
  border-color: var(--input-border-color-error);
  box-shadow: var(--input-focus-ring-error);
}

/*
 * Input field container with standard spacing
 */
.layout-input-container {
  width: 100%;
  margin-bottom: var(--space-md);
}

/*
 * Input field label
 */
.layout-input-label {
  color: var(--brand-brown);
  font-weight: bold;
  margin-bottom: var(--space-sm);
  display: block;
}

/*
 * Input field sublabel/hint
 */
.layout-input-sublabel {
  color: var(--grey-text);
  font-size: var(--font-field-hint);
  margin-top: var(--space-xs);
}


/* ============================
 * SPACING UTILITY CLASSES
 * ============================
 * Common spacing utilities for quick layout adjustments.
 */

.layout-mt-sm { margin-top: var(--space-sm); }
.layout-mt-md { margin-top: var(--space-md); }
.layout-mt-lg { margin-top: var(--space-lg); }
.layout-mt-xl { margin-top: var(--space-xl); }
.layout-mt-2xl { margin-top: var(--space-2xl); }

.layout-mb-sm { margin-bottom: var(--space-sm); }
.layout-mb-md { margin-bottom: var(--space-md); }
.layout-mb-lg { margin-bottom: var(--space-lg); }
.layout-mb-xl { margin-bottom: var(--space-xl); }

.layout-gap-sm { gap: var(--space-sm); }
.layout-gap-md { gap: var(--space-md); }
.layout-gap-lg { gap: var(--space-lg); }


/* ============================
 * DESKTOP FORM SECTION CLASSES
 * ============================
 * Standardized desktop form section styling that was previously
 * duplicated across desktopTextInput.css, desktopNumericInput.css,
 * desktopDropdown.css, etc.
 */

/*
 * Desktop form section container - standard width for form fields
 */
.layout-desktop-form-section {
  width: 360px;
}

/*
 * Top margin for form sections
 */
.layout-desktop-form-section-mt {
  margin-top: var(--space-sm);
}

/*
 * Bottom margin for form sections
 */
.layout-desktop-form-section-mb {
  margin-bottom: var(--space-2xl);
}

/*
 * Form section field title styling
 */
.layout-desktop-form-field-title {
  color: var(--brand-brown);
  font-weight: bold;
}

/*
 * Form section field subtitle styling
 */
.layout-desktop-form-field-subtitle {
  color: var(--grey-text);
}

/*
 * Content top margin for form section content
 */
.layout-desktop-form-content-mt {
  margin-top: var(--space-sm);
}

/*
 * Section gap - standardized spacing between desktop form sections
 * Used for consistent vertical rhythm between major form groups
 * (e.g., between "Conta a debitar", "Para onde", "Para quem", "Quanto e para quê")
 */
.layout-desktop-form-section-gap {
  margin-top: var(--form-section-spacing);
}

/*
 * Available balance display styling
 */
.layout-saldo-disponivel {
  margin-left: 11px;
  margin-top: 5px;
  color: var(--grey-text);
  font-size: var(--font-caption);
}


/* ============================
 * MOBILE FORM SECTION CLASSES
 * ============================
 * Standardized mobile form section styling that was previously
 * duplicated across mobileTextInput.css, mobileNumericInput.css,
 * mobileDropdown.css, etc.
 */

/*
 * Mobile input field container
 */
.layout-mobile-input-container {
  width: 100%;
}

/*
 * Mobile input bottom margin
 */
.layout-mobile-input-mb {
  margin-bottom: var(--space-md);
}

/*
 * Mobile field title styling - uses semantic spacing for title-to-content gap
 */
.layout-mobile-field-title {
  color: var(--brand-brown);
  font-weight: bold;
  font-size: var(--font-subtitle);
  margin-bottom: var(--form-title-content-spacing);
}

/*
 * Mobile field subtitle styling
 */
.layout-mobile-field-subtitle {
  color: var(--grey-text);
  font-size: var(--font-field-hint);
  margin-bottom: var(--space-xs);
}


/* ============================
 * FORM LAYOUT COMPONENTS
 * ============================
 * Gap-based form layout classes for consistent spacing.
 * Use these instead of margin-bottom on individual fields.
 * Benefits: Works with conditional rendering, single source of truth.
 */

/*
 * Form fields container - vertical stack with consistent spacing
 * Use this to wrap multiple form fields for automatic gap-based spacing.
 * Does NOT have width: 100% - shrinks to fit content so parent can center it.
 * Does NOT center children - fields left-align to each other within the section.
 */
.layout-form-fields {
  display: flex;
  flex-direction: column;
  gap: var(--form-field-spacing);
}

/*
 * Individual form field wrapper
 * Contains a label and input with proper internal spacing.
 */
.layout-form-field {
  display: flex;
  flex-direction: column;
  gap: var(--form-field-gap);
  width: 100%;
}

/*
 * Form field with title (for fields that have a FieldTitle component)
 * Adds the standard title styling.
 */
.layout-form-field-title {
  color: var(--brand-brown);
  font-weight: bold;
  font-size: var(--font-body);
}

/*
 * Form buttons container - adds spacing above action buttons
 */
.layout-form-buttons {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: var(--form-button-spacing);
}

/*
 * Form section separator - for larger gaps between form sections
 * Provides SECTION-LEVEL spacing only (between major sections like "De", "Para quem", etc.)
 * Does NOT provide field-to-field spacing - use FormFieldGroup for that.
 * Does NOT have width: 100% - shrinks to fit content so parent can center it.
 * Does NOT center children - fields left-align to each other within the section.
 */
.layout-form-section {
  display: flex;
  flex-direction: column;
}

.layout-form-section:not(:first-child) {
  margin-top: var(--form-section-spacing);
}

/* When form section immediately follows a section header, don't add extra top margin.
 * The SectionHeader's margin-bottom provides the spacing. */
.section-header + .layout-form-section {
  margin-top: 0;
}

/*
 * Title wrapper in form section - resets margin for the content that follows.
 * Title-to-content spacing is handled by FieldTitle's margin-bottom (8px).
 */
.layout-form-section-title {
  /* No margin here - FieldTitle handles its own spacing */
}

/* When title is present, content follows immediately (title handles the gap via margin-bottom) */
.layout-form-section-title + * {
  margin-top: 0;
}

/*
 * Form page content wrapper
 * Previously added extra top spacing on desktop, but this is now
 * handled by --desktop-page-title-content-spacing in desktopPage.css
 * Keeping this class for potential future use (e.g., width constraints)
 */
.layout-form-page-content {
  /* padding-top removed - page title spacing now standardized via --desktop-page-title-content-spacing */
}


/* ============================
 * SHARED INPUT VALIDATION STATES
 * ============================
 * Validation styling for form inputs
 */

/*
 * Valid input state
 */
.layout-input-valid {
  border-color: var(--status-success) !important;
}

.layout-input-valid:focus {
  box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.15) !important;
}

/*
 * Invalid input state
 */
.layout-input-invalid {
  border-color: var(--status-error) !important;
}

.layout-input-invalid:focus {
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15) !important;
}

/*
 * Input wrapper for validation icon positioning
 */
.layout-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.layout-input-wrapper input {
  padding-right: 36px;
}

/*
 * Validation icon styling
 */
.layout-validation-icon {
  position: absolute;
  right: 10px;
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.layout-validation-icon-valid {
  color: var(--status-success);
}

.layout-validation-icon-invalid {
  color: var(--status-error);
}


/* ============================
 * FLEX LAYOUT UTILITY CLASSES
 * ============================
 * Common flex patterns found across multiple pages.
 */

/*
 * Flex container - column centered
 * Used for centered column layouts (e.g., page content, form sections)
 */
.layout-flex-col-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/*
 * Flex container - row centered
 * Used for horizontally centered row layouts
 */
.layout-flex-row-center {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
}

/*
 * Flex container - row space-between
 * Used for rows with items at each end
 */
.layout-flex-row-between {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

/*
 * Full width container
 */
.layout-w-full {
  width: 100%;
}


/* ============================
 * BUTTON CONTAINER CLASSES
 * ============================
 * Common button container patterns.
 */

/*
 * Centered button container (single button)
 */
.layout-button-container {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-lg);
}

/*
 * Action buttons container (multiple buttons)
 */
.layout-action-buttons {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}


/* ============================
 * PAGE TITLE CLASSES
 * ============================
 * Common page title patterns.
 */

/*
 * Title container - centered at top
 */
.layout-title-container {
  display: flex;
  justify-content: center;
  width: 100%;
  padding-top: var(--space-lg);
  padding-bottom: var(--space-md);
}

/*
 * Page title text styling
 */
.layout-page-title {
  font-weight: bold;
  font-size: var(--font-section-title);
}


/* ============================
 * FOOTNOTE/HELPER TEXT CLASSES
 * ============================
 */

/*
 * Footnote text styling
 */
.layout-footnote {
  font-size: var(--font-caption);
  color: var(--text-muted);
  margin-top: var(--space-md);
  font-style: italic;
  text-align: center;
  padding: 0 var(--space-md);
  box-sizing: border-box;
}

/*
 * Helper/muted text
 */
.layout-text-muted {
  color: var(--text-muted);
}

.layout-text-grey {
  color: var(--grey-text);
}


/* ============================
 * TYPOGRAPHY UTILITY CLASSES
 * ============================
 * Semantic typography classes using design tokens.
 * Use these for consistent text sizing across pages.
 */

/* Page-level typography */
.text-page-title {
  font-size: var(--font-page-title);
}

.text-section-title {
  font-size: var(--font-section-title);
}

.text-section-subtitle {
  font-size: var(--font-section-subtitle);
}

/* Content typography */
.text-card-title {
  font-size: var(--font-card-title);
}

.text-body {
  font-size: var(--font-body);
}

.text-body-emphasis {
  font-size: var(--font-body-emphasis);
}

.text-label {
  font-size: var(--font-label);
}

.text-caption {
  font-size: var(--font-caption);
}

/* Data display typography */
.text-amount-large {
  font-size: var(--font-amount-large);
}

.text-amount-medium {
  font-size: var(--font-amount-medium);
}

.text-amount-small {
  font-size: var(--font-amount-small);
}

.text-currency {
  font-size: var(--font-currency);
}

/* Interactive elements */
.text-button {
  font-size: var(--font-button);
}

.text-link {
  font-size: var(--font-link);
}


/* ============================
 * MODAL/OVERLAY UTILITY CLASSES
 * ============================
 * Standardized modal and overlay patterns.
 * Use these instead of defining modal styles in individual page CSS files.
 */

/*
 * Modal overlay - semi-transparent background that covers the viewport
 */
.layout-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/*
 * Modal overlay for page content - centers modal relative to the page content area
 * (offset by the 300px sidebar on desktop). Backdrop still covers full viewport.
 * Uses padding-left to shift the centering point to the right of the sidebar.
 */
.layout-modal-overlay-page-content {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  /* Offset centering to account for 300px sidebar - modal centers in remaining space */
  padding-left: 300px;
  box-sizing: border-box;
}

/*
 * Modal container - centered dialog box
 */
.layout-modal {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 450px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  outline: none;
  animation: kaLoUehblzyAJlBUtEt4 0.3s ease-out;
}

@keyframes kaLoUehblzyAJlBUtEt4 {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/*
 * Modal content wrapper
 */
.layout-modal-content {
  display: flex;
  flex-direction: column;
}

/*
 * Modal header section
 */
.layout-modal-header {
  padding: var(--space-lg) var(--space-lg) var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
}

/*
 * Modal title
 */
.layout-modal-title {
  font-size: var(--font-title);
  font-weight: bold;
  color: var(--brand-brown);
  text-align: center;
}

/*
 * Modal body section
 */
.layout-modal-body {
  padding: var(--space-lg);
}

/*
 * Modal message text
 */
.layout-modal-message {
  font-size: var(--font-body);
  color: var(--text-primary);
  text-align: center;
  margin-bottom: var(--space-md);
  line-height: 1.5;
}

/*
 * Modal info section (for displaying details)
 */
.layout-modal-info {
  background-color: var(--bg-card-alt);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
}

/*
 * Modal info row (label/value pairs)
 */
.layout-modal-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.layout-modal-info-row:last-child {
  margin-bottom: 0;
}

/*
 * Modal info label
 */
.layout-modal-info-label {
  font-weight: 600;
  color: var(--brand-brown);
  font-size: var(--font-label);
}

/*
 * Modal info value
 */
.layout-modal-info-value {
  font-weight: 500;
  color: var(--text-primary);
  font-size: var(--font-body);
  text-align: right;
}

/*
 * Modal actions section (buttons)
 */
.layout-modal-actions {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg) var(--space-lg) var(--space-lg);
  justify-content: center;
}


/* ============================
 * SHEET UTILITY CLASSES
 * ============================
 * Standardized bottom sheet patterns for mobile.
 */

/*
 * Sheet content area
 */
.layout-sheet-content {
  padding: var(--space-lg);
}

/*
 * Sheet header with title and close button
 */
.layout-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  font-size: var(--font-title);
  font-weight: 600;
  color: var(--brand-brown);
}

.layout-sheet-header svg {
  cursor: pointer;
  width: 24px;
  height: 24px;
  color: var(--text-tertiary);
}

/*
 * Sheet scrollable content area
 */
.layout-sheet-scrollable {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-lg);
}

/*
 * Sheet top row (icon + text for account selector style sheets)
 */
.layout-sheet-top-row {
  display: flex;
  flex-direction: row;
  padding: var(--space-lg);
  align-items: center;
}

.layout-sheet-top-row-text {
  color: var(--text-tertiary);
  margin-left: var(--space-sm);
}


/* ============================
 * LIST ITEM UTILITY CLASSES
 * ============================
 * Common patterns for clickable list items.
 */

/*
 * Clickable list item (for sheets and modals)
 */
.layout-list-item {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.layout-list-item:hover {
  background-color: rgba(195, 158, 85, 0.1);
}

.layout-list-item:last-child {
  border-bottom: none;
}

/*
 * List item with card style (for desktop)
 */
.layout-list-item-card {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  background-color: rgba(195, 158, 85, 0.05);
  border: 1px solid rgba(195, 158, 85, 0.2);
  cursor: pointer;
  transition: background-color 0.2s;
}

.layout-list-item-card:hover {
  background-color: rgba(195, 158, 85, 0.15);
}


