/* Common styles shared between index.html and achievement.html */

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

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  background: #faf8f5;
  color: #1a1612;
}

/* Header */
.header {
  background: #1a1612;
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.header-logo-icon {
  font-size: 20px;
}
.header-logo-text {
  font-family: 'Playfair Display', serif;
  font-weight: 800;
  font-size: 17px;
  color: #fff;
  letter-spacing: -0.3px;
}

/* Account Dropdown */
.account-wrapper {
  position: relative;
}
.account-button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 10px;
  padding: 6px 14px;
  cursor: pointer;
  color: #fff;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.15s ease;
}
.account-button:hover {
  background: rgba(255,255,255,0.18);
}
.account-button.signin-cta {
  background: #fff;
  color: #1a1612;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
}
.account-button.signin-cta:hover {
  background: #f7f4f0;
}
.account-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8985a, #d4783a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.account-arrow {
  font-size: 10px;
  transition: transform 0.2s ease;
}
.account-arrow.open {
  transform: rotate(180deg);
}
.account-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  padding: 8px;
  width: 260px;
  border: 1px solid #e8e4df;
  display: none;
  animation: fadeIn 0.15s ease;
}
.account-dropdown.open {
  display: block;
}
.dropdown-user {
  padding: 12px 14px;
  border-bottom: 1px solid #f0ece7;
}
.dropdown-user-name {
  font-size: 14px;
  font-weight: 600;
  color: #1a1612;
}
.dropdown-user-email {
  font-size: 12px;
  color: #8a8078;
}
.dropdown-tier {
  padding: 8px 14px;
}
.dropdown-tier-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.dropdown-tier-label {
  font-size: 13px;
  color: #5a534b;
}
.dropdown-tier-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
}
.dropdown-tier-badge.pro {
  color: #d4783a;
  background: rgba(212,120,58,0.1);
}
.dropdown-tier-badge.free {
  color: #8a8078;
  background: rgba(0,0,0,0.04);
}
.dropdown-tier-usage {
  font-size: 12px;
  color: #8a8078;
}
.dropdown-actions,
.dropdown-signout,
.dropdown-signin {
  border-top: 1px solid #f0ece7;
  padding: 4px 0 0 0;
}
.dropdown-btn,
.dropdown-signout button,
.dropdown-signin button {
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  text-align: left;
  font-size: 13px;
  color: #5a534b;
  cursor: pointer;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
}
.dropdown-btn:hover,
.dropdown-signout button:hover,
.dropdown-signin button:hover {
  background: #f7f4f0;
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}
.form-group:last-of-type {
  margin-bottom: 28px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #5a534b;
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}
.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #e8e4df;
  border-radius: 12px;
  font-size: 15px;
  font-family: 'DM Sans', sans-serif;
  color: #1a1612;
  background: #faf8f5;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-input::placeholder {
  color: #c0b8ae;
}
.form-input:focus {
  border-color: #d4783a;
  box-shadow: 0 0 0 3px rgba(212,120,58,0.12);
}

/* Buttons */
.btn-dark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: #1a1612;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-dark:hover {
  background: #292524;
}

.refresh-btn {
  width: 100%;
  padding: 10px 0;
  background: transparent;
  color: #5a534b;
  border: 1.5px solid #e8e4df;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-top: 8px;
}
.refresh-btn:hover {
  background: #fff;
  border-color: #d4783a;
  color: #d4783a;
}

/* Status Messages */
.status-message {
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}
.status-message.info {
  background: #f0f7ff;
  color: #1e5a8a;
}
.status-message.success {
  background: #e8f5e9;
  color: #2e7d32;
}
.status-message.error {
  background: #ffebee;
  color: #c62828;
}

/* Sign In Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeInOverlay 0.15s ease;
}
.modal-overlay.hidden {
  display: none;
}
.hidden {
  display: none !important;
}
@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-content {
  background: #fff;
  border-radius: 20px;
  padding: 32px;
  width: 90%;
  max-width: 400px;
  position: relative;
  animation: slideUp 0.2s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: #f7f4f0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  color: #5a534b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.modal-close:hover {
  background: #eee9e2;
}
.modal-title {
  font-family: 'Playfair Display', serif;
  font-weight: 800;
  font-size: 24px;
  color: #1a1612;
  margin: 0 0 8px 0;
  text-align: center;
}
.modal-subtitle {
  font-size: 14px;
  color: #8a8078;
  text-align: center;
  margin-bottom: 24px;
}

/* Footer */
.site-footer {
  text-align: center;
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 12px;
}
.site-footer a {
  color: #b0a89e;
  text-decoration: none;
  transition: color 0.15s ease;
}
.site-footer a:hover {
  color: #8a8078;
}

/* Common Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  0% { transform: scale(0.5); opacity: 0; }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Loading Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid #e8e4df;
  border-top-color: #d4783a;
  animation: spin 0.8s linear infinite;
}

/* Responsive */
@media (max-width: 480px) {
  .header {
    padding: 0 16px;
  }
}
