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

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f7fa;
  --bg-card: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #6b7280;
  --border-color: #e5e7eb;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #10b981;
  --danger: #ef4444;
  --shadow: rgba(0, 0, 0, 0.1);
  --shadow-lg: rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border-color: #334155;
  --accent: #60a5fa;
  --accent-hover: #3b82f6;
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-lg: rgba(0, 0, 0, 0.5);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 600px;
  margin: 0 auto;
}

.header {
  text-align: center;
  margin-bottom: 10px;
  padding: 20px 0;
}

.header h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header p {
  color: var(--text-secondary);
  font-size: 14px;
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 8px var(--shadow);
  z-index: 100;
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px var(--shadow-lg);
}

.card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 12px var(--shadow);
  border: 1px solid var(--border-color);
  transition: all 0.3s;
}

.card:hover {
  box-shadow: 0 4px 20px var(--shadow-lg);
}

.promo-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.3s;
}

.promo-card:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.15));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.promo-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.promo-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.promo-icon svg {
  width: 100%;
  height: 100%;
}

.promo-text {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}

.promo-text strong {
  color: var(--accent);
  font-weight: 600;
}

.promo-link {
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.promo-link:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

@media (max-width: 640px) {
  .promo-card {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .promo-link {
    width: 100%;
    justify-content: center;
  }
}

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

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

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

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

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

.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.input-group input,
.input-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: all 0.3s;
  font-family: inherit;
}

.input-group input:focus,
.input-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-group input::placeholder,
.input-group textarea::placeholder {
  color: var(--text-secondary);
  opacity: 0.5;
}

.input-group input::-webkit-input-placeholder,
.input-group textarea::-webkit-input-placeholder {
  color: var(--text-secondary);
  opacity: 0.5;
}

.input-group input::-moz-placeholder,
.input-group textarea::-moz-placeholder {
  color: var(--text-secondary);
  opacity: 0.5;
}

.input-group input:-ms-input-placeholder,
.input-group textarea:-ms-input-placeholder {
  color: var(--text-secondary);
  opacity: 0.5;
}

.input-group .hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.totp-display {
  text-align: center;
  padding: 24px;
  background: var(--bg-secondary);
  border-radius: 12px;
  margin: 20px 0;
}

.totp-code {
  font-size: 48px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  letter-spacing: 8px;
  color: var(--accent);
  margin: 16px 0;
  user-select: none;
  cursor: pointer;
  transition: all 0.3s;
}

.totp-code:hover {
  transform: scale(1.05);
}

.totp-code.copied {
  color: var(--success);
  animation: pulse 0.5s;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.timer-container {
  margin-top: 12px;
}

.timer-bar {
  width: 100%;
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.timer-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #8b5cf6);
  transition: width 1s linear;
  border-radius: 2px;
}

.timer-text {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}

.accounts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.account-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.3s;
}

.account-item:hover {
  background: var(--bg-card);
  transform: translateX(4px);
  box-shadow: 0 2px 8px var(--shadow);
}

.account-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.account-info {
  flex: 1;
}

.account-secret {
  font-size: 14px;
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
  word-break: break-all;
  font-weight: 500;
}

.account-code {
  font-size: 24px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  color: var(--accent);
  margin-left: 16px;
  min-width: 80px;
  text-align: right;
  transition: color 0.3s;
  user-select: none;
  cursor: pointer;
}

.account-code.copied {
  color: var(--success);
  animation: pulse 0.5s;
}

.account-actions {
  display: flex;
  gap: 8px;
  margin-left: 12px;
}

.account-timer-container {
  margin-top: 12px;
}

.account-timer-bar {
  width: 100%;
  height: 3px;
  background: var(--border-color);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.account-timer-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #8b5cf6);
  transition: width 1s linear;
  border-radius: 2px;
}

.account-timer-text {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: left;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.footer {
  text-align: center;
  padding: 20px;
  margin-top: 30px;
  color: var(--text-secondary);
  font-size: 14px;
  border-top: 1px solid var(--border-color);
}

.footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s;
}

.footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px var(--shadow-lg);
  animation: slideUp 0.3s;
}

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

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

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

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s;
}

.modal-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 4px 20px var(--shadow-lg);
  display: none;
  align-items: center;
  gap: 12px;
  z-index: 2000;
  animation: slideIn 0.3s;
}

.notification.active {
  display: flex;
}

.notification.success {
  border-left: 4px solid var(--success);
}

.notification.error {
  border-left: 4px solid var(--danger);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 640px) {
  .header h1 {
    font-size: 28px;
  }
  
  .totp-code {
    font-size: 36px;
    letter-spacing: 4px;
  }
  
  .account-item-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .account-code {
    margin-left: 0;
    margin-top: 12px;
    text-align: left;
    width: 100%;
  }
  
  .account-actions {
    margin-left: 0;
    margin-top: 12px;
    width: 100%;
  }
}