/* ==========================================================================
   Aetheric Quantitative (watanabequant.com) - Redesign Stylesheet
   Adhering Strictly to project_axia/marketing/design/lp/DESIGN.md
   ========================================================================== */

/* --- Custom Properties / Design Tokens --- */
:root {
  /* Colors */
  --color-deep-void: #120F17;
  --color-regal-purple: #7B61A3;
  --color-champagne-gold: #C5A36A;
  --color-marble-white: #E4E1E8;
  --color-glass-surface: #2D1B36;
  --color-outline: #9a8f81;
  
  /* Lead Magnet (watanabequant) Colors */
  --color-wq-dark: #150f1f;
  --color-wq-purple-dark: #2a1a3a;
  --color-wq-gold: #d4af37;
  --color-wq-gold-light: #f3e5ab;
  --color-wq-gold-dark: #aa8c2c;
  --color-wq-input-bg: #1e1428;
  --color-wq-input-border: #3d2b4f;
  
  /* Fonts */
  --font-display: 'Bodoni Moda', serif;
  --font-sans: 'IBM Plex Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Radii */
  --radius-sm: 4px;
  --radius-lg: 12px;
}

/* --- Base Reset & Setup --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100%; /* Allows body to expand past the initial viewport */
  background-color: var(--color-deep-void);
  font-family: var(--font-sans);
  color: var(--color-marble-white);
  overflow-x: hidden; /* Keep horizontal scrollbars hidden */
  overflow-y: auto;   /* Enable vertical scrolling if content height overflows the viewport */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Layout Container --- */
.lp-container {
  position: relative;
  width: 100%;
  min-height: 100dvh; /* Use min-height to allow background and containers to grow with content on mobile */
  background-image: url('lp_bg.png'); /* Desktop background image */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: background-image 0.5s ease-in-out;
}

/* Subtle marble texture overlay representing 10-15% opacity texture as requested in DESIGN.md */
.lp-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 30% 30%, rgba(123, 97, 163, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 1;
}

.content-wrapper {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1440px;
  min-height: 100dvh; /* Dynamic min-height allows contents to flow past viewport height on mobile */
  margin: 0 auto;
  display: flex;
  align-items: flex-start; /* Upper-aligned layout to precisely position the form container */
  justify-content: flex-start; /* Form aligned to left to preserve right side graphic */
  padding-left: 0; /* Left padding optimized to 0 for desktop web */
  padding-top: 59vh; /* Shifts the form exactly below the pre-printed background hero text */
}

/* --- Form Container --- */
.form-container {
  width: 100%;
  max-width: 600px; /* Optimized desktop width (600px) as requested */
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 64px; /* Added luxury bottom margin to prevent touching screen edge on desktop */
  animation: formReveal 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --- Glassmorphic Card (Core Component) --- */
.glass-card {
  position: relative;
  /* Dual-gradient technique: Padding-box for deep void/purple transparency, Border-box for glowing diagonal border */
  background: 
    linear-gradient(rgba(45, 27, 54, 0.55), rgba(45, 27, 54, 0.55)) padding-box,
    linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.05) 100%) border-box;
  border: 1px solid transparent;
  border-radius: var(--radius-lg); /* 12px for large component cards */
  padding: 12px; /* Super tight margin around form inputs to feel integrated */
  backdrop-filter: blur(35px); /* Premium backdrop blur (20px to 40px specified) */
  -webkit-backdrop-filter: blur(35px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

/* --- Subscribe Form Layout --- */
.subscribe-form {
  width: 100%;
}

.input-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px; /* Professional tight layout spacing */
  width: 100%;
}

.input-wrapper {
  flex: 1;
  position: relative;
}

/* --- Glass Sunken Input --- */
.glass-input {
  width: 100%;
  height: 48px;
  background-color: rgba(18, 15, 23, 0.65); /* "glass-sunken" dark semi-transparent */
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm); /* Inputs 4px radius as per DESIGN.md */
  padding: 0 16px;
  color: var(--color-marble-white);
  font-family: var(--font-mono); /* JetBrains Mono for precision quant input text */
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.02em;
  outline: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-input::placeholder {
  color: rgba(228, 225, 232, 0.35); /* Marble White muted at ~35% */
  font-family: var(--font-mono);
  font-weight: 400;
}

/* Focus Glow State (Adhering to DESIGN.md Glow Gold) */
.glass-input:focus {
  background-color: rgba(18, 15, 23, 0.85);
  border-color: var(--color-champagne-gold);
  box-shadow: 0 0 12px rgba(197, 163, 106, 0.35); /* Subtle Champagne Gold shadow glow */
}

/* --- Champagne Gold Primary Button (High-Gloss Finish) --- */
.gold-button {
  height: 48px;
  padding: 0 24px;
  
  /* HIGH-GLOSS METALLIC FINISH (Linear Gradient mimicking physical brass/gold light reflection) */
  background: linear-gradient(180deg, 
    #FFE6B3 0%,    /* Top highlight */
    #C5A36A 45%,   /* Core gold */
    #A28148 55%,   /* Bottom shadow recess */
    #C5A36A 100%   /* Secondary bounce reflection */
  );
  
  color: var(--color-deep-void); /* Champagne Gold bg with Deep Void text */
  border: none;
  border-radius: var(--radius-sm); /* Rigid high-finance 4px radius */
  font-family: var(--font-mono); /* Monospace brand tags */
  font-size: 11px; /* Scaled perfectly */
  font-weight: 700; /* Robust weight to stand out against high-gloss background */
  letter-spacing: 0.08em; /* Generous tracking for monospace button text */
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  
  /* Double-layer inner shadows to recreate the stunning tactile 3D light edge catching of the mockup */
  box-shadow: 
    inset 0 1.5px 0 rgba(255, 255, 255, 0.45), /* White top edge reflection */
    inset 0 -1px 0 rgba(0, 0, 0, 0.25),        /* Dark bottom recess shadow */
    0 4px 15px rgba(197, 163, 106, 0.3);       /* Soft outer glow */
      
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Button Hover State */
.gold-button:hover {
  background: linear-gradient(180deg, 
    #FFF0CC 0%, 
    #D1B27B 45%, 
    #B29156 55%, 
    #D1B27B 100%
  );
  box-shadow: 
    inset 0 1.5px 0 rgba(255, 255, 255, 0.6), 
    inset 0 -1px 0 rgba(0, 0, 0, 0.2),
    0 6px 20px rgba(197, 163, 106, 0.5);
  transform: translateY(-1px);
}

/* Button Active State */
.gold-button:active {
  transform: translateY(1px);
  box-shadow: 0 0 8px rgba(197, 163, 106, 0.25);
}

/* --- CSS Keyframe Animations --- */
@keyframes formReveal {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Responsive Media Queries
   ========================================================================== */

/* --- Tablet Devices --- */
@media (max-width: 1023px) {
  .lp-container {
    background-image: url('lp_bg_sp.png'); /* Swap to mobile / smartphone background image */
  }

  .content-wrapper {
    padding: 0 32px; /* Margin-tablet: 32px */
    justify-content: center; /* Center form on smaller viewports */
    align-items: flex-start;
    padding-top: 77vh; /* Positions form exactly in the safe gap between the flower and the bottom on tablet */
  }

  .form-container {
    max-width: 420px;
    margin-bottom: 0; /* Reset desktop margin-bottom to keep tablet status-quo */
  }
}

/* --- Smartphone Devices (Fluid Mobile Layout) --- */
@media (max-width: 768px) {
  .lp-container {
    background-image: url('lp_bg_sp.png'); /* Keep mobile background image */
    background-position: center 30%; /* Shift background slightly upwards for best framing */
  }

  .content-wrapper {
    padding: 0 16px; /* Margin-mobile: 16px */
    justify-content: center;
    align-items: flex-start; /* Top-aligned relative to the target gap */
    padding-top: 73vh; /* Placed perfectly in the safe visual gap between the purple flower and the bound book */
  }

  .form-container {
    max-width: 360px; /* Sleek compact layout */
    gap: 0;
    margin-bottom: 0; /* Reset desktop margin-bottom to keep smartphone status-quo */
  }

  /* Keep the horizontal single-line row layout on smartphone to preserve the ultra-thin high-end look */
  .glass-card {
    padding: 8px; /* Tighter padding for mobile screens */
    border-radius: var(--radius-sm); /* Sharp corners represent the architectural luxury quant style */
  }

  .input-group {
    flex-direction: row; /* FORCE horizontal alignment to prevent overlap with laptop graphic below */
    gap: 8px;
  }

  .glass-input {
    height: 42px; /* Compact height */
    padding: 0 12px;
    font-size: 12px;
  }

  .gold-button {
    height: 42px; /* Match input height */
    padding: 0 16px;
    font-size: 10px;
    letter-spacing: 0.05em;
  }
  
  /* Force vertical layout on mobile to accommodate lead magnet text beautifully */
  .input-group {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    width: 100%;
  }

  .input-wrapper {
    width: 100%;
  }

  .btn-gold {
    width: 100% !important;
  }
}

/* ==========================================================================
   Lead Magnet (The No-Cap FCF Audit Blueprint) Custom Styles
   ========================================================================== */

/* 1. Base Glass Panel Setup (Desktop-First / 1024px+ defaults) */
.glass-panel {
  position: relative;
  /* Restore original dual-gradient semi-transparent frosted glass design */
  background: 
    linear-gradient(rgba(45, 27, 54, 0.55), rgba(45, 27, 54, 0.55)) padding-box,
    linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.05) 100%) border-box !important;
  border: 1px solid transparent !important;
  border-radius: 16px !important;
  padding: 48px 48px !important; /* Elegant padding inside 600px box */
  overflow: hidden;
  backdrop-filter: blur(35px) !important; /* Premium backdrop blur restored */
  -webkit-backdrop-filter: blur(35px) !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
  
  /* Desktop size optimization (600px width, dynamic height) */
  width: 600px !important;
  height: auto !important;
  
  /* Flexbox to center contents vertically and horizontally */
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
}

.glass-panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6) !important;
}

/* 2. Desktop Vertical Stack Layout (1024px+) */
.form-content-wrapper {
  display: flex;
  flex-direction: column; /* Stacked vertically as requested */
  align-items: center; /* Center horizontally */
  justify-content: center; /* Center vertically inside */
  gap: 32px; /* Perfect spacing between the text/copy box and the form */
  width: 100%;
}

.lead-magnet-header {
  flex: none;
  margin-bottom: 0;
  max-width: 820px; /* Allow the centered copy to wrap beautifully */
  text-align: center; /* Center-align the text! */
}

.subscribe-form {
  flex: none;
  width: 100%;
  max-width: 440px; /* Perfect width for the centered single-line or multi-line inputs on desktop */
}

/* 3. Common Typography and Accent Components */
.top-glow-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(212, 175, 55, 0.5), transparent);
  pointer-events: none;
}

.lead-magnet-title {
  font-family: var(--font-display) !important;
  font-size: 1.85rem; /* Highly readable and elegant size on desktop */
  font-weight: 500;
  color: #ffffff;
  margin-bottom: 16px;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.lead-magnet-desc {
  font-family: var(--font-mono) !important;
  font-size: 0.95rem; /* Perfectly proportioned description text */
  color: rgba(228, 225, 232, 0.6);
  line-height: 1.65;
  letter-spacing: 0.01em;
}

.gold-text {
  background: linear-gradient(to right, #d4af37, #f3e5ab);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.btn-gold {
  height: 48px;
  padding: 0 32px;
  background: linear-gradient(135deg, #aa8c2c 0%, #f3e5ab 50%, #d4af37 100%) !important;
  color: #150f1f !important;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono) !important;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.25);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-gold:hover {
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
  transform: translateY(-1px);
}

.btn-gold:active {
  transform: translateY(1px);
}

/* Screen reader helper utility (Tailwind accessibility compatibility) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ==========================================================================
   Responsive Fallbacks (iPad & iPhone layout preservation)
   ========================================================================== */

@media (max-width: 1023px) {
  /* iPad / Tablet: 縦積みレイアウトに戻し、元のコンパクトな見た目を完全維持 */
  .glass-panel {
    padding: 32px !important; /* 元のタブレットパディングを維持 */
    width: auto !important; /* Restore normal automatic sizing on tablet */
    height: auto !important; /* Restore normal automatic height */
    display: block !important; /* Restore default block display */
  }
  
  .form-content-wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  
  .lead-magnet-header {
    flex: none;
    margin-bottom: 24px;
    max-width: 100%;
    text-align: left; /* Restore original left alignment on smaller devices if that was standard */
  }
  
  .subscribe-form {
    flex: none;
    max-width: 100%;
  }

  .lead-magnet-title {
    font-size: 1.25rem; /* タブレットやスマホでのフォントサイズ縮小 */
  }

  .lead-magnet-desc {
    font-size: 0.85rem; /* Revert description font size on smaller viewports */
  }
}

@media (max-width: 768px) {
  /* iPhone / Smartphone: スマホ向けコンパクトサイズを完全維持 */
  .glass-panel {
    padding: 20px 16px !important; /* スマホ用の極薄余白 */
    border-radius: var(--radius-sm) !important; /* シャープな高級ブランド感 */
  }
}
