/* =================================================================
   NEW: Global Styles & Variables (from main.css)
   ================================================================= */

/* --- Font Setup (Inter) --- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/Inter/Inter-VariableFont.woff2') format('woff2');
}

:root {
    /* Peritiq Color System: High-Tech, Sleek, Confident */
    /* Primitives */
    --peritiq-yellow: #F7CB18;
    --peritiq-yellow-hover: #E0B615;
    --peritiq-cyan-electric: #00C7C7;
    --peritiq-rose-graphite: #B9929F;
    --peritiq-sand-warm: #F4E5C2;
    --peritiq-blue-deep: #191923;
    --peritiq-graphite-soft: #292b30;
    --peritiq-graphite-medium: #4A4D55;
    --peritiq-gray-light: #A0A3AB;
    --peritiq-white: #FFFFFF;
    
    /* Semantic Tokens (Prefixed for Peritiq Brand) */
    --peritiq-background-base: var(--peritiq-blue-deep);
    --peritiq-background-secondary: var(--peritiq-graphite-soft);
    --peritiq-text-primary: var(--peritiq-white);
    --peritiq-text-secondary: var(--peritiq-gray-light);
    --peritiq-text-accent: var(--peritiq-cyan-electric);
    --peritiq-text-inverse: var(--peritiq-blue-deep);
    --peritiq-border-primary: var(--peritiq-graphite-medium);
    --peritiq-brand-primary: var(--peritiq-yellow);
    --peritiq-brand-primary-hover: var(--peritiq-yellow-hover);
    --peritiq-accent-signal: var(--peritiq-cyan-electric);

    /* Typography */
    --peritiq-font-heading: 'Inter', sans-serif;
    --peritiq-font-body: 'Inter', sans-serif;
    
    /* Sizing & Radius */
    --peritiq-border-radius: 0.375rem; /* 6px */

    /* --- ADDED FROM app.css --- */
    --header-height: 64px;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

html, body {
 min-height: 100%;           /* allow natural page growth */
 overflow-y: auto;           /* ensure scrolling when needed */

}
/* ---
   THIS IS THE MISSING RULE
   It applies your base styles to all pages, fixing the black text issue.
--- */
body {
    font-family: var(--peritiq-font-body);
    background-color: var(--peritiq-background-base);
    color: var(--peritiq-text-primary);
    display: block;             /* restore default flow */
}

/* =================================================================
   Toast Notifications (Global)
   ================================================================= */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    transform: translateX(20px);
    padding: 14px 20px;
    border-radius: var(--peritiq-border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 380px;
    text-align: left;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    border-left: 4px solid;
    background: var(--peritiq-graphite-soft);
    color: var(--peritiq-text-primary);
}
.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
}
.toast-notification.info {
    border-left-color: var(--peritiq-cyan-electric);
    background: #1a2f2f;
}
.toast-notification.success {
    border-left-color: #22c55e;
    background: #1a2b1f;
}
.toast-notification.warning {
    border-left-color: var(--peritiq-yellow);
    background: #2b2718;
}
.toast-notification.error {
    border-left-color: #ef4444;
    background: #2b1a1a;
}

/* =================================================================
   APPEND THIS TO THE END OF global.css
   Password Input Wrapper & Toggle Button (Global)
   ================================================================= */
.password-input-wrapper {
    position: relative;
    width: 100%;
}

.password-input-wrapper input {
    width: 100%;
    padding-right: 50px !important;
}

.password-toggle-btn {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--peritiq-text-secondary);
    cursor: pointer;
    padding: 4px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    line-height: 1;
}

.password-toggle-btn:hover {
    color: var(--peritiq-accent-signal);
}

.password-toggle-btn .material-symbols-outlined {
    font-size: 20px;
}

/* =================================================================
   Password Requirements Checklist (Global)
   ================================================================= */
.password-checklist {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: flex-start;
}

.password-checklist li {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--peritiq-text-secondary);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    padding: 0.3rem 0.6rem;
    transition: all 0.2s ease;
}

.password-checklist li::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.password-checklist li.met {
    color: #4ade80;
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.2);
}

.password-checklist li.met::before {
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
}

/* =================================================================
   Form Error/Success Messages (Global)
   ================================================================= */
.form-error-message {
    font-size: 0.75rem;
    color: #f87171;
    margin-top: 0.4rem;
    display: none;
    align-items: center;
    gap: 0.3rem;
}

.form-error-message.show {
    display: flex;
}

.form-error-message::before {
    content: '⚠';
    font-size: 0.7rem;
}

.form-success-message {
    font-size: 0.75rem;
    color: #4ade80;
    margin-top: 0.4rem;
    display: none;
    align-items: center;
    gap: 0.3rem;
}

.form-success-message.show {
    display: flex;
}

.form-success-message::before {
    content: '✓';
    font-size: 0.7rem;
}

.form-group input.input-error {
    border-color: #f87171 !important;
}

.form-group input.input-valid {
    border-color: #4ade80 !important;
}

/* =================================================================
   SECURITY MODAL SYSTEM (Global - shared by Chat & Investor)
   ================================================================= */

.security-modal-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1100;
}

.security-modal-dialog {
  position: relative;
  background: linear-gradient(180deg, #1A1B20 0%, #141519 100%);
  border: 1px solid var(--peritiq-border-primary);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  padding: 20px;
  border-radius: 12px;
  width: 90%;
  max-width: 420px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
}

.security-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--peritiq-border-primary);
  margin-bottom: 20px;
}

.security-modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--peritiq-text-primary);
  margin: 0;
}

.security-modal-close {
  background: transparent;
  border: 1px solid var(--peritiq-border-primary);
  color: var(--peritiq-text-primary);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s ease;
}

.security-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

.security-modal-body {
  padding: 0;
}

.security-modal-dialog h4 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--peritiq-text-primary);
  margin: 0 0 20px 0;
}

.security-modal-dialog p {
  font-size: 0.9rem;
  color: var(--peritiq-text-secondary);
  margin: 0 0 16px 0;
}

.security-modal-dialog .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.security-modal-dialog .form-group:last-child {
  margin-bottom: 0;
}

.security-modal-dialog .form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--peritiq-text-secondary);
  line-height: 1.3;
  margin-bottom: 0 !important;
}

.security-modal-dialog .form-control {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--peritiq-border-primary);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--peritiq-text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  outline: none;
  box-sizing: border-box;
}

.security-modal-dialog .form-control:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #444;
}

.security-modal-dialog .form-control:focus {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--peritiq-accent-signal);
  box-shadow: 0 0 0 1px var(--peritiq-accent-signal);
}

.security-modal-dialog .form-control.input-valid {
  border-color: #198754;
  box-shadow: 0 0 0 1px #198754;
}

.security-modal-dialog .form-control.input-error {
  border-color: #e74c5e;
  box-shadow: 0 0 0 1px #e74c5e;
}

.security-modal-dialog .form-actions,
.security-modal-dialog .modal-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 20px;
  gap: 12px;
}

.security-modal-dialog .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.security-modal-dialog .btn-primary {
  background: var(--peritiq-brand-primary);
  color: var(--peritiq-text-inverse);
  border-color: var(--peritiq-brand-primary);
}

.security-modal-dialog .btn-primary:hover {
  background: var(--peritiq-brand-primary-hover);
  border-color: var(--peritiq-brand-primary-hover);
}

.security-modal-dialog .btn-primary:disabled {
  background: var(--peritiq-brand-primary);
  opacity: 0.5;
  cursor: wait;
}

.security-modal-dialog .btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--peritiq-text-primary);
  border: 1px solid var(--peritiq-border-primary);
}

.security-modal-dialog .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.security-modal-dialog .btn-danger {
  background: rgba(220, 53, 69, 0.15);
  color: #ef4444;
  border-color: rgba(220, 53, 69, 0.3);
}

.security-modal-dialog .btn-danger:hover {
  background: rgba(220, 53, 69, 0.25);
}

/* Feedback Alerts (Security Modals) */
.auth-alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 16px;
  display: block;
  line-height: 1.5;
}

.auth-alert-error {
  background-color: rgba(220, 53, 69, 0.1);
  color: #e74c5e;
  border: 1px solid rgba(220, 53, 69, 0.3);
}

.auth-alert-success {
  background-color: rgba(0, 199, 199, 0.1);
  color: var(--peritiq-brand-primary);
  border: 1px solid rgba(0, 199, 199, 0.3);
}

/* Password Strength Meter (Security Modals) */
.security-modal-dialog .password-strength-meter {
  height: 10px;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  padding: 2px;
  box-sizing: border-box;
  display: none;
}

.security-modal-dialog .strength-bar {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background-color: #dc3545;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.security-modal-dialog .strength-text {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--peritiq-text-secondary);
  margin-left: 8px;
  white-space: nowrap;
}

.security-modal-dialog .password-strength-meter.weak .strength-bar,
.security-modal-dialog .password-strength-meter.strength-weak .strength-bar {
  width: 33%;
  background-color: #dc3545;
}

.security-modal-dialog .password-strength-meter.medium .strength-bar,
.security-modal-dialog .password-strength-meter.strength-medium .strength-bar {
  width: 66%;
  background-color: #ffc107;
}

.security-modal-dialog .password-strength-meter.strong .strength-bar,
.security-modal-dialog .password-strength-meter.strength-strong .strength-bar {
  width: 100%;
  background-color: #198754;
}