:root {
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-success: #10b981;
  --color-success-hover: #059669;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;
}

body {
  font-family: var(--font-main);
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-main, #0f172a);
  color: var(--text-main, #f8fafc);
  margin: 0;
  padding: 0;
}

h1, h2, h3, h4, h5, h6,
.brand-title,
.section-title,
.hero-title,
.faq-section-title {
  font-family: var(--font-heading);
}

.mono,
code {
  font-family: var(--font-mono);
}

/* Tool Layout */
.tool-layout {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  box-sizing: border-box;
  flex: 1 0 auto;
  width: 100%;
}

.tool-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
}

/* Hero Section */
.tool-hero {
  margin-bottom: 2rem;
}

.tool-hero-text h1 {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 0.5rem 0;
  color: var(--text-title, #f8fafc);
}

.tool-hero-text p {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-muted, #94a3b8);
  margin: 0 0 1rem 0;
  max-width: 860px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card-secondary, #1e293b);
  border: 1px solid var(--border-color, #334155);
  color: var(--text-main, #e2e8f0);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
}

.chip-success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

/* Upload Dropzone */
.upload-container {
  background: var(--bg-card, #1e293b);
  border: 2px dashed var(--border-color, #334155);
  border-radius: 1rem;
  padding: 3rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  position: relative;
  margin-bottom: 2rem;
}

.upload-container:hover,
.upload-container.drag-over {
  border-color: var(--color-primary);
  background: rgba(37, 99, 235, 0.05);
}

.file-input-hidden {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-icon-box {
  width: 68px;
  height: 68px;
  margin: 0 auto 1.25rem;
  background: rgba(37, 99, 235, 0.12);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #60a5fa;
}

.upload-text h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: var(--text-title, #f8fafc);
}

.upload-link {
  color: #60a5fa;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.upload-text p {
  color: var(--text-muted, #94a3b8);
  font-size: 0.95rem;
  margin: 0 0 1.25rem 0;
}

.upload-tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.file-tag {
  background: var(--bg-subtle, #0f172a);
  border: 1px solid var(--border-color, #334155);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
}

.demo-btn-wrap {
  margin-top: 1.25rem;
  position: relative;
  z-index: 10;
}

.btn-secondary-subtle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color, #334155);
  color: var(--text-main, #e2e8f0);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary-subtle:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #64748b;
}

/* Security Workspace Card */
.security-workspace {
  background: var(--bg-card, #1e293b);
  border: 1px solid var(--border-color, #334155);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  margin-bottom: 2rem;
}

.workspace-header {
  padding: 1.25rem 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-color, #334155);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.file-info-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.file-badge-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-meta-box h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-title, #f8fafc);
}

.file-meta-box span {
  font-size: 0.82rem;
  color: var(--text-muted, #94a3b8);
}

.workspace-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Form Sections */
.form-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-title, #f8fafc);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 768px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main, #e2e8f0);
}

.field-help {
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
  margin-top: 0.2rem;
}

.input-with-actions {
  position: relative;
  display: flex;
  align-items: center;
}

.form-control {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.85rem;
  background: var(--bg-subtle, #0f172a);
  border: 1px solid var(--border-color, #334155);
  border-radius: 8px;
  color: var(--text-main, #f8fafc);
  font-size: 0.92rem;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.input-icon-btn {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-icon-btn:hover {
  color: var(--text-main, #f8fafc);
}

/* Password Strength Meter */
.strength-meter-wrap {
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.strength-bar-track {
  height: 6px;
  background: #334155;
  border-radius: 9999px;
  overflow: hidden;
}

.strength-bar-fill {
  height: 100%;
  width: 0%;
  transition: width 0.3s ease, background-color 0.3s ease;
  border-radius: 9999px;
}

.strength-text {
  font-size: 0.76rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
}

/* Generator Button */
.btn-generate-pwd {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.35);
  color: #60a5fa;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 0.35rem;
  align-self: flex-start;
  transition: all 0.15s ease;
}

.btn-generate-pwd:hover {
  background: rgba(37, 99, 235, 0.22);
}

/* Permissions Checkboxes */
.permissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
}

.permission-card {
  background: var(--bg-subtle, #0f172a);
  border: 1px solid var(--border-color, #334155);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.permission-card:hover {
  border-color: #64748b;
}

.permission-card input[type="checkbox"] {
  margin-top: 0.2rem;
  cursor: pointer;
  width: 17px;
  height: 17px;
  accent-color: var(--color-primary);
}

.permission-info h5 {
  font-size: 0.88rem;
  font-weight: 600;
  margin: 0 0 0.15rem 0;
  color: var(--text-title, #f8fafc);
}

.permission-info p {
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
  margin: 0;
  line-height: 1.4;
}

/* Algorithm Selector */
.cipher-selector-box {
  background: var(--bg-subtle, #0f172a);
  border: 1px solid var(--border-color, #334155);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.cipher-radio-group {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.cipher-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
}

.cipher-label input[type="radio"] {
  accent-color: var(--color-primary);
}

/* Action Area */
.actions-footer-bar {
  padding: 1.25rem 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-color, #334155);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 0.65rem 1.4rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  color: var(--text-main, #f8fafc);
  border: 1px solid var(--border-color, #334155);
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #64748b;
}

/* In-Browser Verification Card */
.verification-card {
  margin-top: 2rem;
  background: var(--bg-card, #1e293b);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.verif-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.verif-header h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: #34d399;
}

.verif-box {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.verif-box input {
  max-width: 320px;
}

.verif-result-area {
  margin-top: 0.75rem;
  padding: 1rem;
  background: var(--bg-subtle, #0f172a);
  border-radius: 8px;
  border: 1px solid var(--border-color, #334155);
  display: none;
}

#verif-canvas {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  margin: 0 auto;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
  padding: 1rem;
  box-sizing: border-box;
}

.modal-card {
  background: var(--bg-card, #1e293b);
  border: 1px solid var(--border-color, #334155);
  border-radius: 1rem;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.modal-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-color, #334155);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.15rem;
  margin: 0;
  color: var(--text-title, #f8fafc);
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.btn-close-modal:hover {
  color: var(--text-main, #f8fafc);
  background: rgba(255, 255, 255, 0.08);
}

.modal-body {
  padding: 1.25rem;
  font-size: 0.92rem;
  color: var(--text-main, #e2e8f0);
}

.modal-footer {
  padding: 1rem 1.25rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-color, #334155);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Toast */
.toast-notice {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #10b981;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  z-index: 10000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* FAQ Section */
.faq-section {
  margin-top: 3.5rem;
  background: var(--bg-card, #1e293b);
  border: 1px solid var(--border-color, #334155);
  border-radius: 1rem;
  padding: 2rem;
}

.faq-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 1.5rem 0;
  color: var(--text-title, #f8fafc);
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--border-color, #334155);
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--bg-subtle, #0f172a);
}

.faq-item summary {
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  user-select: none;
  color: var(--text-title, #f8fafc);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 400;
  color: #60a5fa;
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-content {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-muted, #94a3b8);
}
