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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #ffffff;
  min-height: 100vh;
  color: #000;
} 

.screen {
  min-height: 100vh;
}

/* ===== Login Screen ===== */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.login-box {
  background: #fff;
  padding: 32px;
  border-radius: 2px;
  box-shadow: none;
  border: 1px solid #000;
  text-align: center;
  max-width: 420px;
  width: 100%;
} 

.login-box h1 {
  font-size: 2em;
  margin-bottom: 10px;
  color: #000;
}

.login-box p {
  color: #666;
  margin-bottom: 30px;
}

.auth-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border: 1px solid #000;
}

.toggle-btn {
  flex: 1;
  padding: 10px;
  background: #fff;
  color: #000;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s;
}

.toggle-btn:first-child {
  border-right: 1px solid #000;
}

.toggle-btn.active {
  background: #000;
  color: #fff;
}

#loginForm,
#registerForm {
  display: flex;
  flex-direction: column;
}

#loginForm input,
#registerForm input {
  width: 100%;
  padding: 12px;
  border: 1px solid #000;
  border-radius: 2px;
  font-size: 16px;
  text-align: center;
  margin-bottom: 14px;
}

#loginForm input:focus,
#registerForm input:focus {
  outline: none;
  border-color: #000;
}

#loginForm button,
#registerForm button {
  width: 100%;
  padding: 12px;
  background: #000;
  color: #fff;
  border: 1px solid #000;
  border-radius: 2px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
}

#loginForm button:hover,
#registerForm button:hover {
  opacity: 0.9;
} 

/* ===== Dashboard ===== */
.header {
  background: #fff;
  padding: 16px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: none;
  border-bottom: 1px solid #000;
}

.header h1 {
  color: #000;
  font-size: 1.2em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-name {
  font-weight: 500;
  color: #000;
}

.logout-btn {
  padding: 8px 14px;
  background: #000;
  color: #fff;
  border: 1px solid #000;
  border-radius: 2px;
  cursor: pointer;
  font-weight: bold;
}

.logout-btn:hover {
  opacity: 0.95;
} 

.container {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0;
}

/* ===== Floating Action Button Speed Dial ===== */
.fab-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
}

.fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #000;
  color: #fff;
  border: 2px solid #000;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.fab:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.fab.active .fab-icon {
  transform: rotate(45deg);
}

.fab-icon {
  font-size: 1.5em;
  transition: transform 0.3s ease;
}

.fab-options {
  position: absolute;
  bottom: 70px;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.fab-container.active .fab-options {
  opacity: 1;
  pointer-events: all;
  bottom: 75px;
}

.fab-option {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  border: 2px solid #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transform: scale(0);
}

.fab-container.active .fab-option {
  transform: scale(1);
}

.fab-container.active .fab-option:nth-child(1) {
  transition-delay: 0.05s;
}

.fab-container.active .fab-option:nth-child(2) {
  transition-delay: 0.1s;
}

.fab-container.active .fab-option:nth-child(3) {
  transition-delay: 0.15s;
}

.fab-option:hover {
  background: #000;
  color: #fff;
  transform: scale(1.1);
}

.fab-option i {
  font-size: 1.2em;
} 

/* ===== Modal ===== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  overflow-y: auto;
  padding: 20px;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #fff;
  border-radius: 0;
  border: 2px solid #000;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: none;
  animation: none;
} 

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 25px 30px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  color: #333;
}

.close-btn {
  background: none;
  border: none;
  font-size: 2em;
  color: #999;
  cursor: pointer;
  line-height: 1;
  transition: color 0.3s;
}

.close-btn:hover {
  color: #333;
}

.modal-body {
  padding: 30px;
}

/* ===== Camera ===== */
.camera-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#cameraVideo {
  width: 100%;
  max-height: 400px;
  border-radius: 8px;
  background: #000;
  display: none;
}

#cameraVideo.active {
  display: block;
}

.camera-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.camera-btn {
  flex: 1;
  min-width: 120px;
  padding: 10px;
  background: #000;
  color: #fff;
  border: 1px solid #000;
  border-radius: 2px;
  font-weight: bold;
  cursor: pointer;
}

.camera-btn:hover {
  opacity: 0.95;
} 

.status-text {
  text-align: center;
  color: #666;
  font-size: 14px;
  min-height: 20px;
}

/* ===== Add Section ===== */
.add-section {
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
  display: none; /* Hidden by default, shown in modal */
}

.add-section h2 {
  margin-bottom: 20px;
  color: #333;
}

.add-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  background: #fff;
  border: 1px solid #000;
  border-radius: 2px;
  cursor: pointer;
  font-weight: bold;
}

.tab-btn.active {
  background: #000;
  color: #fff;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.tab-content form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tab-content input[type="text"] {
  padding: 10px;
  border: 1px solid #000;
  border-radius: 2px;
  font-size: 14px;
}

.tab-content input[type="text"]:focus {
  outline: none;
  border-color: #000;
}

.tab-content button {
  padding: 10px;
  background: #000;
  color: white;
  border: 1px solid #000;
  border-radius: 2px;
  font-weight: bold;
  cursor: pointer;
}

.tab-content button:hover {
  opacity: 0.95;
} 

.file-upload {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-label {
  padding: 12px;
  background: #fff;
  border: 1px dashed #000;
  border-radius: 2px;
  text-align: center;
  cursor: pointer;
}

.file-label:hover {
  background: #fff;
  border-color: #000;
} 

#fileName {
  text-align: center;
  color: #666;
  font-size: 14px;
}

/* ===== TOTP List ===== */
.totp-section {
  background: #fff;
  padding: 0;
  border-radius: 0;
  border: none;
}

.totp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.totp-header h2 {
  color: #000;
}

.refresh-btn {
  padding: 8px 12px;
  background: #000;
  color: #fff;
  border: 1px solid #000;
  border-radius: 2px;
  cursor: pointer;
  font-weight: bold;
}

.refresh-btn:hover {
  opacity: 0.95;
} 

.totp-list {
  display: grid;
  gap: 15px;
}

.totp-card {
  background: #fff;
  padding: 18px;
  border-radius: 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #000;
  border: 1px solid #000;
  transition: none;
}

.totp-card:hover {
  transform: none;
} 

.totp-info {
  flex: 1;
}

.totp-app-name {
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 10px;
}

.totp-code {
  font-size: 2.5em;
  font-weight: bold;
  letter-spacing: 5px;
  font-family: 'Courier New', monospace;
  margin-bottom: 5px;
}

.totp-secret-container {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9em;
}

.secret-label {
  opacity: 0.8;
}

.totp-secret {
  font-family: monospace;
  opacity: 0.8;
  letter-spacing: 2px;
}

.secret-toggle,
.secret-copy {
  background: none;
  border: none;
  padding: 4px 6px;
  cursor: pointer;
  color: #000;
  font-size: 0.9em;
  transition: opacity 0.2s;
}

.secret-toggle:hover,
.secret-copy:hover {
  opacity: 0.6;
}

.totp-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* Circular Countdown */
.countdown-circle {
  position: relative;
  width: 80px;
  height: 80px;
}

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

.countdown-circle-bg {
  fill: none;
  stroke: rgba(0, 0, 0, 0.08);
  stroke-width: 6;
}

.countdown-circle-progress {
  fill: none;
  stroke: #000;
  stroke-width: 6;
  stroke-linecap: butt;
  transition: stroke-dashoffset 0.5s linear;
}

.countdown-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.2em;
  font-weight: bold;
  color: #000;
}

.qr-btn {
  padding: 8px 16px;
  background: #000;
  color: white;
  border: 1px solid #000;
  border-radius: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.qr-btn:hover {
  background: #fff;
  color: #000;
}

.delete-btn {
  padding: 8px 12px;
  background: transparent;
  color: #000;
  border: 1px solid #000;
  border-radius: 2px;
  cursor: pointer;
  font-weight: bold;
}

.delete-btn:hover {
  background: #f3f3f3;
} 

/* ===== Messages ===== */
.error {
  color: #000;
  margin-top: 12px;
  padding: 8px;
  border-radius: 2px;
  background: #fff;
  border: 1px solid #000;
  display: none;
}

.error.show {
  display: block;
}

.success {
  color: #000;
  margin-top: 12px;
  padding: 8px;
  border-radius: 2px;
  background: #fff;
  border: 1px solid #000;
  display: none;
}

.success.show {
  display: block;
}

.loading {
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 1.1em;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-state h3 {
  font-size: 1.5em;
  margin-bottom: 10px;
}

/* ===== QR Code Modal ===== */
.qr-modal-content {
  max-width: 500px;
}

.qr-modal-body {
  text-align: center;
}

#qrCodeContainer {
  margin: 20px 0;
  padding: 20px;
  background: white;
  border-radius: 8px;
  display: inline-block;
}

#qrCodeImage {
  max-width: 100%;
  height: auto;
  display: block;
}

.qr-info {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 8px;
  margin: 20px 0;
  text-align: left;
}

.qr-info p {
  margin: 8px 0;
  font-size: 14px;
  word-break: break-all;
}

.qr-secret-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.qr-secret-value {
  font-family: monospace;
  letter-spacing: 2px;
  flex: 1;
}

.qr-info strong {
  color: #000;
  font-weight: bold;
}

.download-btn {
  width: 100%;
  padding: 12px;
  background: #000;
  color: white;
  border: 1px solid #000;
  border-radius: 0;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.download-btn:hover {
  background: #fff;
  color: #000;
}

/* ===== Copy Notification ===== */
.copy-notification {
  position: fixed;
  bottom: 100px;
  right: 30px;
  background: #000;
  color: #fff;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ===== Responsive ===== */ */
@media (max-width: 768px) {
  .header {
    padding: 15px 20px;
  }

  .header h1 {
    font-size: 1.2em;
  }

  .totp-card {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .totp-code {
    font-size: 2em;
  }

  .totp-actions {
    width: 100%;
    justify-content: center;
  }

  .add-tabs {
    flex-direction: column;
  }

  .fab {
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
  }

  .modal-content {
    margin: 10px;
  }

  .camera-controls {
    flex-direction: column;
  }

  .camera-btn {
    width: 100%;
  }
}
