@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #07080B;
  --bg-grid: rgba(255, 165, 0, 0.02);
  --card-bg: rgba(16, 18, 26, 0.8);
  --card-border: rgba(255, 255, 255, 0.06);
  --card-border-active: rgba(255, 165, 0, 0.3);
  --orange: #FFA500;
  --orange-glow: rgba(255, 165, 0, 0.25);
  --orange-gradient: linear-gradient(135deg, #FFaa00, #FF5500);
  --red: #EF4444;
  --red-glow: rgba(239, 68, 68, 0.3);
  --green: #22C55E;
  --text-primary: #FFFFFF;
  --text-secondary: #8F93A3;
  --text-muted: #5A5F7A;
  --sidebar-width: 280px;
}

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

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  /* Dark tech grid background pattern */
  background-image: 
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center center;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
}

a {
  color: var(--orange);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  text-shadow: 0 0 8px var(--orange-glow);
  opacity: 0.9;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: #1B1E2A;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--orange);
}

/* Glassmorphism utility */
.glass {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
}

/* Standard Premium Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 15px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
  gap: 8px;
}

.btn-primary {
  background: var(--orange-gradient);
  color: #07080B;
  box-shadow: 0 4px 20px rgba(255, 136, 0, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(255, 136, 0, 0.45), 0 0 10px rgba(255, 165, 0, 0.3);
}

.btn-secondary {
  background: rgba(34, 37, 51, 0.6);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(34, 37, 51, 0.9);
  border-color: var(--orange);
  transform: translateY(-2px);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--red);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: var(--red);
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

/* Form Inputs */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.input-field {
  width: 100%;
  padding: 14px 16px;
  background: rgba(16, 18, 26, 0.9);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: white;
  font-family: inherit;
  font-size: 15px;
  transition: all 0.25s ease;
}

.input-field:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 10px var(--orange-glow);
}

/* ==========================================================================
   LANDING PAGE (index.html) STYLES
   ========================================================================== */

/* Navbar */
.navbar {
  padding: 24px 0;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.logo span {
  color: var(--orange);
}

.logo svg {
  width: 36px;
  height: 36px;
}

/* Hero Section */
.hero {
  padding-top: 160px;
  padding-bottom: 80px;
  position: relative;
  text-align: center;
}

.hero-glow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 165, 0, 0.08) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.hero h1 {
  font-size: 4.2rem;
  line-height: 1.15;
  margin-bottom: 24px;
  letter-spacing: -1px;
}

.hero h1 span {
  color: var(--orange);
  background: var(--orange-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto 40px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
}

/* Graphic Showcase */
.showcase {
  margin: 40px auto 100px;
  text-align: center;
  position: relative;
}

.showcase-img {
  max-width: 100%;
  height: auto;
  border-radius: 20px;
  border: 1px solid var(--card-border);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
  transition: transform 0.5s ease;
}

.showcase-img:hover {
  transform: scale(1.01);
}

/* Features Grid */
.features {
  padding: 80px 0;
  border-top: 1px solid var(--card-border);
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.section-header p {
  color: var(--text-secondary);
  max-width: 550px;
  margin: 0 auto;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.feature-card {
  padding: 40px 32px;
  border-radius: 18px;
  transition: all 0.3s ease;
}

.feature-card:hover {
  border-color: var(--orange-glow);
  transform: translateY(-5px);
}

.feature-icon {
  font-size: 36px;
  margin-bottom: 24px;
  display: inline-block;
}

.feature-card h3 {
  font-size: 20px;
  margin-bottom: 12px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
}

/* Footer */
footer {
  padding: 60px 0;
  text-align: center;
  border-top: 1px solid var(--card-border);
  color: var(--text-muted);
  font-size: 14px;
}

footer p {
  margin-bottom: 12px;
}

footer a {
  color: var(--text-secondary);
  margin: 0 10px;
}

/* ==========================================================================
   DASHBOARD PAGE (dashboard.html) STYLES
   ========================================================================== */

.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  border-right: 1px solid var(--card-border);
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  background: rgba(10, 11, 15, 0.95);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
}

.sidebar-brand {
  margin-bottom: 40px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
  color: var(--text-primary);
  background: rgba(255, 165, 0, 0.08);
}

.nav-item.active {
  border-left: 3px solid var(--orange);
}

.sidebar-footer {
  margin-top: auto;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Main Dashboard Area */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 40px 48px;
}

/* Top bar statistics */
.stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.server-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(34, 37, 51, 0.4);
  border: 1px solid var(--card-border);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-secondary);
}

.status-dot.online {
  background-color: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.status-dot.syncing {
  background-color: var(--orange);
  box-shadow: 0 0 8px var(--orange);
}

/* Dashboard Action Bar */
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 30px;
}

.search-wrapper {
  position: relative;
  flex: 1;
  max-width: 450px;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background: rgba(16, 18, 26, 0.8);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: white;
  font-size: 14px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.sync-bar {
  display: flex;
  gap: 12px;
}

/* Backup Files Selector Panel */
.backup-panel {
  padding: 24px;
  border-radius: 14px;
  margin-bottom: 30px;
}

.backup-panel h3 {
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.backup-list-select {
  display: flex;
  gap: 12px;
  align-items: center;
}

.backup-select {
  flex: 1;
  padding: 12px 16px;
  background: rgba(7, 8, 11, 0.9);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: white;
  font-family: inherit;
  font-size: 14px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238F93A3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
}

/* 2FA Accounts Grid */
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

/* Account Card styling */
.account-card {
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.account-card:hover {
  transform: translateY(-3px);
  border-color: var(--card-border-active);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 1px var(--orange-glow);
}

.account-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}

.account-info {
  flex: 1;
}

.account-label {
  font-size: 17px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.account-issuer {
  font-size: 12px;
  color: var(--orange);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.account-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.account-code-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.account-code {
  font-family: 'Outfit', monospace;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 2px;
  color: white;
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease;
}

.account-code:hover {
  color: var(--orange);
}

.account-code.warning {
  color: var(--red);
}

/* Progress countdown ring on dashboard */
.timer-container {
  position: relative;
  width: 44px;
  height: 44px;
}

.timer-ring-back {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 4;
}

.timer-ring-front {
  fill: none;
  stroke: var(--orange);
  stroke-width: 4;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}

.timer-ring-front.warning {
  stroke: var(--red);
}

.timer-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: var(--text-secondary);
}

.timer-text.warning {
  color: var(--red);
}

/* Card Control Panel Overlay */
.card-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  opacity: 0;
  transition: opacity 0.2s ease;
  display: flex;
  gap: 8px;
}

.account-card:hover .card-actions {
  opacity: 1;
}

.card-action-btn {
  background: rgba(34, 37, 51, 0.9);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.card-action-btn:hover {
  color: var(--orange);
  border-color: var(--orange);
}

.card-action-btn.delete-btn:hover {
  color: var(--red);
  border-color: var(--red);
}

/* Empty Vault Dashboard State */
.empty-vault {
  text-align: center;
  padding: 60px 40px;
  border-radius: 16px;
  border: 1px dashed var(--card-border);
  grid-column: 1 / -1;
  max-width: 500px;
  margin: 40px auto;
}

.empty-vault-icon {
  font-size: 48px;
  margin-bottom: 20px;
}

.empty-vault h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

.empty-vault p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

/* ==========================================================================
   MODAL & OVERLAY STYLES
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(7, 8, 11, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 100%;
  max-width: 480px;
  border-radius: 20px;
  padding: 36px;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.8);
}

.modal-backdrop.open .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.modal-icon {
  font-size: 32px;
}

.modal-title h2 {
  font-size: 22px;
  line-height: 1.2;
}

.modal-body {
  margin-bottom: 28px;
  font-size: 15px;
  color: var(--text-secondary);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Full Screen Passphrase / Lock Overlay */
.lock-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lock-container {
  width: 100%;
  max-width: 400px;
  padding: 40px;
  border-radius: 20px;
  text-align: center;
}

.lock-icon {
  font-size: 48px;
  margin-bottom: 24px;
  display: inline-block;
  animation: pulse 2s infinite ease-in-out;
}

.lock-title {
  font-size: 24px;
  margin-bottom: 12px;
}

.lock-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 30px;
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  padding: 14px 24px;
  border-radius: 10px;
  background: rgba(16, 18, 26, 0.95);
  border: 1px solid var(--orange);
  color: white;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  z-index: 99999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.error {
  border-color: var(--red);
}

.toast.success {
  border-color: var(--green);
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.05); opacity: 1; text-shadow: 0 0 15px var(--orange-glow); }
  100% { transform: scale(1); opacity: 0.9; }
}

/* Responsive Overrides */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.8rem;
  }
  .dashboard-layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--card-border);
  }
  .main-content {
    margin-left: 0;
    padding: 24px;
  }
  .stats-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .action-bar {
    flex-direction: column;
    align-items: stretch;
  }
}
