:root {
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --border-color: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary-color: #38bdf8;
  --primary-hover: #0284c7;
  --accent-color: #6366f1;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

/* Developer Banner */
.dev-banner {
  background: linear-gradient(90deg, #1e1b4b 0%, #311b92 100%);
  border-bottom: 1px solid #4338ca;
  padding: 8px 24px;
  font-size: 13px;
}

.banner-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.banner-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.banner-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-field {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  width: 320px;
}

.input-field:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Navigation */
.navbar {
  background-color: rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.status-locked {
  background-color: rgba(245, 158, 11, 0.15);
  color: var(--warning-color);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-unlocked {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--success-color);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
  display: inline-block;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-panel {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--primary-color);
}

.user-name {
  font-size: 13px;
  font-weight: 600;
}

/* App Layout */
.app-container {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  width: 100%;
}

/* Sidebar */
.sidebar {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.meta-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.meta-header h2 {
  font-size: 16px;
  font-weight: 700;
}

.meta-item label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.meta-value {
  font-size: 14px;
  font-weight: 600;
}

.meta-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-tech {
  background-color: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

.badge-confidential {
  background-color: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 12px 0;
}

/* User Panel */
.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 16px 0;
}

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-color);
}

.user-name {
  font-size: 14px;
  font-weight: 700;
}

.user-email {
  font-size: 12px;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn-primary {
  background-color: var(--primary-color);
  color: #0f172a;
}

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

.btn-secondary {
  background-color: var(--bg-card-hover);
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: #475569;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.btn-outline:hover {
  background-color: var(--bg-card-hover);
  color: var(--text-main);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn:disabled, .btn-icon:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-card-hover);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  cursor: pointer;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.full-width {
  width: 100%;
}

.hidden {
  display: none !important;
}

/* Viewer Section */
.viewer-section {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.viewer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.doc-title-bar h1 {
  font-size: 18px;
  font-weight: 700;
}

.viewer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Document Workspace & Overlay */
.document-workspace {
  position: relative;
  flex: 1;
  min-height: 520px;
  background-color: #090d16;
  padding: 24px;
  overflow: auto;
  display: flex;
  justify-content: center;
}

.lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: var(--transition);
}

.lock-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.lock-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(56, 189, 248, 0.2));
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.lock-card h2 {
  font-size: 20px;
  font-weight: 700;
}

.lock-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

.g-signin-wrapper {
  margin: 12px 0;
  min-height: 44px;
  display: flex;
  justify-content: center;
}

.demo-option-box {
  background-color: rgba(30, 41, 59, 0.6);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.demo-label {
  font-size: 12px;
  color: var(--text-muted);
}

.security-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: left;
  line-height: 1.4;
  margin-top: 8px;
}

.security-note svg {
  flex-shrink: 0;
  color: var(--success-color);
}

/* Document Page Styling */
.document-pages {
  width: 100%;
  max-width: 800px;
  transition: filter 0.4s ease;
}

.document-pages.blurred {
  filter: blur(12px);
  user-select: none;
  pointer-events: none;
}

.doc-page {
  background-color: #ffffff;
  color: #1e293b;
  border-radius: var(--radius-md);
  padding: 48px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  min-height: 750px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 12px;
  margin-bottom: 24px;
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}

.doc-body h2 {
  font-size: 22px;
  color: #0f172a;
  margin-bottom: 12px;
}

.doc-body p {
  color: #334155;
  margin-bottom: 20px;
  line-height: 1.6;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.metric-card {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}

.metric-value {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin: 4px 0;
}

.metric-trend {
  font-size: 11px;
  font-weight: 700;
}

.metric-trend.positive {
  color: #16a34a;
}

.doc-body h3 {
  font-size: 16px;
  color: #0f172a;
  margin: 20px 0 10px 0;
}

.doc-body ul {
  padding-left: 20px;
  color: #334155;
}

.doc-body li {
  margin-bottom: 8px;
}

/* Google Login Button (Lock Screen) */
.google-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background-color: #ffffff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: 24px;
  padding: 12px 24px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(60,64,67, 0.12);
  transition: background-color 0.2s, box-shadow 0.2s, transform 0.1s;
  width: 100%;
  max-width: 320px;
}

.google-login-btn:hover {
  background-color: #f8f9fa;
  box-shadow: 0 2px 8px rgba(60,64,67, 0.2);
}

.google-login-btn:active {
  transform: scale(0.98);
}

.google-icon {
  flex-shrink: 0;
}

/* Google Login Modal Overlay */
.google-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(32, 33, 36, 0.65);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 56px 16px 24px 16px;
  animation: googleModalFadeIn 0.25s ease-out;
  overflow-y: auto;
}

@keyframes googleModalFadeIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.google-modal-card {
  background-color: #ffffff;
  color: #202124;
  width: 100%;
  max-width: 440px;
  border-radius: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 24px 28px 20px 28px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.google-modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: none;
  border: none;
  font-size: 24px;
  color: #5f6368;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.google-modal-close:hover {
  background-color: #f1f3f4;
}

.google-modal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 20px;
  position: relative;
}

.google-logo-lg {
  margin-bottom: 8px;
}

.google-demo-badge {
  display: inline-block;
  background-color: #e8f0fe;
  color: #1a73e8;
  border: 1px solid #c2e7ff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.google-modal-title {
  font-size: 22px;
  font-weight: 400;
  color: #202124;
  margin-bottom: 4px;
}

.google-modal-subtitle {
  font-size: 14px;
  color: #5f6368;
}

.account-picker-title {
  font-size: 15px;
  font-weight: 500;
  color: #202124;
  margin-bottom: 12px;
}

.account-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid #dadce0;
  border-bottom: 1px solid #dadce0;
  margin-bottom: 20px;
}

.account-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 12px;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid #f1f3f4;
  transition: background-color 0.15s;
}

.account-item:last-child {
  border-bottom: none;
}

.account-item:hover {
  background-color: #f8f9fa;
}

.account-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.account-avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #e8f0fe;
  color: #1a73e8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.account-details {
  display: flex;
  flex-direction: column;
}

.account-name {
  font-size: 14px;
  font-weight: 500;
  color: #3c4043;
}

.account-email {
  font-size: 12px;
  color: #5f6368;
}

/* Google / Gmail Step Forms & Floating Labels */
.google-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.google-input-group {
  position: relative;
  width: 100%;
}

.google-input-field {
  width: 100%;
  height: 54px;
  padding: 18px 14px 6px 14px;
  font-size: 16px;
  color: #202124;
  border: 1px solid #dadce0;
  border-radius: 4px;
  outline: none;
  background: transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.google-input-field:focus {
  border-color: #1a73e8;
  border-width: 2px;
  padding: 17px 13px 5px 13px;
}

.google-input-label {
  position: absolute;
  left: 14px;
  top: 16px;
  color: #5f6368;
  font-size: 16px;
  pointer-events: none;
  transition: 0.15s ease all;
  background-color: #ffffff;
  padding: 0 4px;
}

.g-prefix {
  position: absolute;
  left: 14px;
  top: 16px;
  font-size: 16px;
  font-weight: 500;
  color: #202124;
  pointer-events: none;
  user-select: none;
  z-index: 2;
}

.google-input-field.with-prefix,
.input-field.with-prefix {
  padding-left: 40px !important;
  letter-spacing: 1.5px;
  font-weight: 500;
}

.input-error,
.input-field.input-error,
.google-input-field.input-error {
  border-color: #d93025 !important;
  border-width: 2px !important;
}

.error-msg {
  color: #d93025;
  font-size: 12px;
  text-align: left;
  margin-top: 6px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.35;
}

.error-msg svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.google-input-field:focus ~ .google-input-label,
.google-input-field:not(:placeholder-shown) ~ .google-input-label {
  top: -8px;
  left: 10px;
  font-size: 12px;
  color: #1a73e8;
  font-weight: 500;
}

.google-form-link {
  text-align: left;
  margin-top: -6px;
}

.google-form-link a {
  color: #1a73e8;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.google-form-link a:hover {
  text-decoration: underline;
}

.google-info-text {
  font-size: 14px;
  color: #5f6368;
  text-align: left;
  line-height: 1.4;
  margin: 16px 0 24px 0;
}

.google-info-text a {
  color: #1a73e8;
  text-decoration: none;
}

.google-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.google-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 18px;
  border: 1px solid #dadce0;
  background-color: #ffffff;
  color: #3c4043;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 6px;
  transition: background-color 0.2s;
}

.google-user-chip:hover {
  background-color: #f8f9fa;
}

.google-checkbox-group {
  text-align: left;
  margin: 4px 0 16px 0;
}

.google-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #3c4043;
  cursor: pointer;
  user-select: none;
}

.google-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #1a73e8;
  cursor: pointer;
}

.google-modal-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #f1f3f4;
  font-size: 12px;
  color: #5f6368;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-links .right-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  color: #5f6368;
  text-decoration: none;
}

.footer-links a:hover {
  color: #202124;
}

/* Modal Indeterminate Loader Bar */
.google-modal-loader {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background-color: #e8f0fe;
  overflow: hidden;
}

.loader-bar {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #4285F4, #EA4335, #FBBC05, #34A853);
  animation: googleLoading 1.2s infinite ease-in-out;
}

@keyframes googleLoading {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(0%); }
  100% { transform: translateX(100%); }
}

/* ==========================================
   Responsive & Mobile Design System
   ========================================== */

@media (max-width: 992px) {
  .app-container {
    padding: 0 16px;
    margin: 16px auto;
  }
}

@media (max-width: 768px) {
  /* Developer Banner */
  .dev-banner {
    padding: 10px 16px;
  }

  .banner-container {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .banner-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .banner-controls label {
    margin-left: 0 !important;
    margin-top: 4px;
  }

  .banner-controls .input-field {
    width: 100% !important;
    max-width: 100%;
  }

  .banner-controls .btn {
    width: 100%;
    margin-top: 4px;
  }

  /* Navigation */
  .nav-container {
    padding: 12px 16px;
  }

  .brand-name {
    font-size: 17px;
  }

  .status-indicator {
    padding: 4px 10px;
    font-size: 12px;
  }

  /* Viewer Section */
  .viewer-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
  }

  .doc-title-bar h1 {
    font-size: 16px;
    line-height: 1.3;
  }

  .viewer-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .app-container {
    padding: 0 16px;
    margin: 16px auto;
  }

  .document-workspace {
    padding: 16px 12px;
    min-height: 480px;
  }

  .lock-overlay {
    padding: 24px;
  }

  /* Lock Card */
  .lock-card {
    padding: 28px 20px;
    gap: 14px;
    border-radius: var(--radius-md);
  }

  .lock-card h2 {
    font-size: 18px;
  }

  .lock-subtitle {
    font-size: 13px;
  }

  /* Document Pages & Grid */
  .doc-page {
    padding: 24px 18px;
    min-height: auto;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .doc-body h2 {
    font-size: 18px;
  }

  .doc-body p {
    font-size: 14px;
  }

  /* Google Modal */
  .google-modal-overlay {
    padding: 12px;
  }

  .google-modal-card {
    padding: 24px 20px 20px 20px;
    border-radius: 20px;
  }

  .google-modal-title {
    font-size: 20px;
  }

  .google-modal-subtitle {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .nav-container {
    padding: 10px 12px;
  }

  .brand-icon {
    width: 32px;
    height: 32px;
  }

  .brand-name {
    font-size: 15px;
  }

  .status-text {
    font-size: 11px;
  }

  .lock-card {
    padding: 20px 14px;
  }

  .google-login-btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  .google-modal-card {
    padding: 20px 16px 16px 16px;
    border-radius: 16px;
  }

  .google-modal-actions {
    gap: 10px;
  }

  .google-btn-blue {
    padding: 10px 20px;
    font-size: 13px;
  }

  .google-btn-text {
    font-size: 13px;
  }

  .footer-links {
    flex-direction: column;
    gap: 8px;
    align-items: center;
    text-align: center;
  }
}
