/* 2FA Authenticator - Luxury Dark Blue & Liquid Gold Aesthetic */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@600;700;800&display=swap');

:root {
  --bg-dark: #050814;
  --bg-card: rgba(11, 17, 35, 0.88);
  --bg-input: rgba(5, 9, 20, 0.95);
  --bg-inner-box: rgba(7, 12, 26, 0.85);
  
  --gold-primary: #f3c06b;
  --gold-metallic: #d4af37;
  --gold-bright: #ffe28a;
  --gold-gradient: linear-gradient(135deg, #ffe28a 0%, #d4af37 50%, #a3740e 100%);
  --gold-gradient-hover: linear-gradient(135deg, #fff0b3 0%, #e5c158 50%, #b8860b 100%);
  --gold-glow: rgba(212, 175, 55, 0.28);
  --gold-glow-strong: rgba(243, 192, 107, 0.55);
  
  --border-gold: rgba(212, 175, 55, 0.25);
  --border-gold-bright: rgba(243, 192, 107, 0.45);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.14) 0%, transparent 55%),
    radial-gradient(circle at 10% 40%, rgba(30, 58, 138, 0.22) 0%, transparent 45%),
    radial-gradient(circle at 90% 80%, rgba(212, 175, 55, 0.1) 0%, transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(4, 7, 16, 1) 0%, rgba(3, 5, 12, 1) 100%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* Main Container */
.app-container {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
}

/* Master Glass Card */
.master-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 24px;
  padding: 2rem 2.25rem;
  backdrop-filter: blur(24px);
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.7),
    0 0 40px rgba(212, 175, 55, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.master-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--gold-primary) 50%, transparent 100%);
  opacity: 0.8;
}

/* Header Section */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.shield-badge-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #131c38 0%, #090e1f 100%);
  border: 1.5px solid var(--gold-primary);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-primary);
  box-shadow: 0 0 20px var(--gold-glow), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.header-title-group h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 4vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.header-title-group h1 span {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-title-group p {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: var(--gold-primary);
  padding: 0.4rem 0.85rem;
  border-radius: 30px;
  font-size: 0.775rem;
  font-weight: 700;
  box-shadow: 0 0 12px var(--gold-glow);
  white-space: nowrap;
}

/* Secret Key Bar */
.secret-section {
  margin-bottom: 1.75rem;
}

.label-text {
  display: block;
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.input-field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-field {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border-gold);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  padding-right: 7.5rem;
  color: var(--gold-bright);
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 3.2vw, 1.05rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  outline: none;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
  transition: all 0.3s ease;
}

.input-field:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.3), inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.btn-paste {
  position: absolute;
  right: 6px;
  background: var(--gold-gradient);
  border: none;
  color: #040712;
  border-radius: 10px;
  padding: 0.55rem 1rem;
  font-family: var(--font-heading);
  font-size: 0.825rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 10px var(--gold-glow);
  transition: all 0.25s ease;
  white-space: nowrap;
}

.btn-paste:hover {
  background: var(--gold-gradient-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px var(--gold-glow-strong);
}

/* Responsive Input Adjustment for Mobile */
@media (max-width: 480px) {
  .input-field-wrapper {
    flex-direction: column;
    gap: 0.5rem;
  }
  .input-field {
    padding-right: 1rem;
  }
  .btn-paste {
    position: static;
    width: 100%;
  }
}

/* Two-Column Content Grid (OTP Top/Left, QR Bottom/Right) */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 230px;
  gap: 1.5rem;
  align-items: stretch;
}

@media (max-width: 720px) {
  .master-card {
    padding: 1.25rem;
  }
  .content-grid {
    grid-template-columns: 1fr;
  }
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }
  /* On Mobile view: OTP Panel is FIRST (Order 1), QR Panel is BELOW (Order 2) */
  .otp-panel {
    order: 1;
  }
  .qr-panel {
    order: 2;
  }
}

/* OTP Panel (Main Centerpiece) */
.otp-panel {
  background: linear-gradient(180deg, rgba(12, 19, 40, 0.95) 0%, rgba(7, 12, 26, 0.98) 100%);
  border: 1.5px solid var(--border-gold-bright);
  border-radius: 20px;
  padding: 1.5rem 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.6), 0 10px 25px rgba(0, 0, 0, 0.4);
}

.otp-header-text {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold-primary);
  font-weight: 800;
}

/* 6 Digit OTP Boxes (Fluid & Fully Visible) */
.otp-boxes {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  margin: 1.1rem 0;
  width: 100%;
}

.otp-digit {
  flex: 1;
  max-width: 48px;
  height: 60px;
  background: linear-gradient(180deg, #0d162d 0%, #050a18 100%);
  border: 2px solid rgba(212, 175, 55, 0.45);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: clamp(1.4rem, 4.5vw, 2rem);
  font-weight: 800;
  color: var(--gold-bright);
  text-shadow: 0 0 12px var(--gold-glow);
  box-shadow: 0 6px 16px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.otp-boxes.updating .otp-digit {
  border-color: var(--gold-primary);
  color: #ffffff;
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 0 18px var(--gold-glow-strong);
}

/* Timer Bar */
.timer-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 1.1rem;
}

.timer-ring-wrapper {
  position: relative;
  width: 34px;
  height: 34px;
}

.timer-svg {
  transform: rotate(-90deg);
}

.timer-circle-bg {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 3.5;
  fill: none;
}

.timer-circle {
  stroke: var(--gold-primary);
  stroke-width: 4;
  stroke-linecap: round;
  fill: none;
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
  filter: drop-shadow(0 0 6px var(--gold-primary));
}

.timer-text {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold-bright);
}

/* Big Gold Action Button */
.btn-copy-otp {
  width: 100%;
  background: var(--gold-gradient);
  border: none;
  border-radius: 14px;
  padding: 0.9rem 1.25rem;
  color: #040712;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  box-shadow: 0 6px 20px var(--gold-glow);
  transition: all 0.25s ease;
}

.btn-copy-otp:hover {
  background: var(--gold-gradient-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--gold-glow-strong);
}

/* QR Panel (Below on Mobile, Right on Desktop) */
.qr-panel {
  background: var(--bg-inner-box);
  border: 1px solid var(--border-gold);
  border-radius: 18px;
  padding: 1.25rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 15px rgba(0,0,0,0.4);
}

.qr-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.qr-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.qr-image-wrapper {
  background: #040712;
  padding: 0.5rem;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  margin-bottom: 0.6rem;
}

.qr-image-wrapper img {
  width: 135px;
  height: 135px;
  border-radius: 6px;
  display: block;
}

.qr-footer-tag {
  font-size: 0.725rem;
  color: var(--text-dim);
  font-weight: 600;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: linear-gradient(135deg, #0e172e 0%, #060b19 100%);
  border: 1.5px solid var(--gold-primary);
  color: var(--gold-bright);
  padding: 0.8rem 1.5rem;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.7), 0 0 20px var(--gold-glow);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.9rem;
  font-weight: 700;
  z-index: 1000;
  opacity: 0;
  white-space: nowrap;
  transition: all 0.35s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
