/* ===================== Account Page Wrapper ===================== */
/* Shared editorial layout language (matches subscription.html):
   flat cards, hairline borders, muted headings, generous consistent spacing. */
/* Scoped border-box reset: without it, width:100% + padding overflows the
   viewport on mobile (there is no global reset in styles.css). */
.account-container,
.account-container * {
    box-sizing: border-box;
}

.account-container {
    width: 100%;
    max-width: 900px;
    margin: 1.5rem auto 2rem;
    padding: 0 1.5rem;
}

/* Title */
.account-title {
    font-size: clamp(1.8rem, 4vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-bottom: 1.75rem;
    color: var(--text-primary);
}

/* ========================= Card Section ========================= */
.account-card {
    background: #fff;
    padding: 1.75rem 2rem;
    border-radius: 12px;
    border: 1px solid rgba(15,23,42,0.1);
    box-shadow: 0 1px 2px rgba(15,23,42,0.04);
    margin-bottom: 1.5rem;
}

/* ========================= Card Headings ========================= */
.account-card h3 {
    margin-top: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.account-card h2 {
    margin-top: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ========================= Form Inputs ========================= */
.account-form label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #475569;
    display: block;
    margin-bottom: 0.4rem;
}

.account-form input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.7rem 0.8rem;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1.2rem;
}

.account-form input:focus {
    border-color: #43b0b3;
    box-shadow: 0 0 0 3px rgba(67,176,179,0.3);
    outline: none;
}

/* ========================= Buttons ========================= */
.account-button {
    padding: 0.75rem 1.5rem;
    background: var(--brand-primary);
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.account-button:hover {
    background: #3a999c;
}

/* Danger button (delete account, etc.) */
.account-button-danger {
    background: #ff5757;
}

.account-button-danger:hover {
    background: #e23e3e;
}

/* ========================= User Info Display ========================= */
.account-info-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    justify-content: space-between;
    background: #f1f5f9;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    margin-bottom: 0.8rem;
}

.account-info-label {
    font-weight: 600;
    color: #475569;
}

.info-text, .edit-btn, input {
  margin-left: 0px;
}

.info-text {
  flex: 1;
  text-align: right;
}

input {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

/* ================== Profile Photo Preview ================== */
#photo-preview {
  width: 150px;
  height: 150px;
  border-radius: 12px;
  margin-top: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  object-fit: cover;
}

#crop-container {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1 / 1;
  margin: 10px auto;
  position: relative;
  touch-action: none;
}

.cropper-view-box,
.cropper-face {
  border-radius: 50%;
}

.cropper-container {
  width: 100% !important;
  height: 100% !important;
}


/* ================== Profile Photo Display ================== */
#info-photo {
  width: 150px;
  height: 150px;
  border-radius: 12px;
  margin-top: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  object-fit: cover;
  display: block;
}

/* Profile photo wrapper */
.profile-photo-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

#profile-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Buttons below the image */
.profile-photo-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}


/* ===================== SUBSCRIPTIONS ===================== */

#subscriptions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.subscription-item {
  border: 1px solid rgba(15,23,42,0.1);
  border-radius: 10px;
  padding: 14px 16px;
  background: #fff;
  transition: border-color 0.2s ease;
}

.subscription-item:hover {
  border-color: rgba(15,23,42,0.2);
}

.subscription-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.subscription-name {
  font-weight: 600;
  font-size: 15px;
}

.subscription-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
}

.subscription-status.active {
  background: rgba(67,176,179,0.15);
  color: #2c7f81;
}

.subscription-status.inactive {
  background: rgba(0,0,0,0.08);
  color: #555;
}

.subscription-dates {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #666;
  margin-top: 8px;
}


/* ================== Pending Invites ================== */
.pending-invite-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 0.6rem;
  background: #fff;
}

.pending-invite-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pending-invite-trip {
  font-weight: 600;
  font-size: 15px;
  color: #1e293b;
}

.pending-invite-meta {
  font-size: 13px;
  color: #64748b;
}

.pending-invite-accept-btn {
  flex-shrink: 0;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
}

/* ================== Responsive Design ================== */
@media (max-width: 600px) {
    .account-info-row {
        flex-direction: column;
        gap: 0.4rem;
    }
}

@media (max-width: 900px) {
  .account-container {
    max-width: 100%;
    width: 100%;
    padding: 0 1rem;
  }

  .account-card {
    padding: 1.5rem 1.25rem;
  }
}

@media (max-width: 768px) {
  .account-title {
    font-size: 1.5rem;
  }

  .account-card h3 {
    font-size: 1.2rem;
  }

  .account-info-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .info-text {
    text-align: left;
    margin-top: 0.5rem;
  }

  input {
    margin-top: 0.5rem;
  }
}

@media (max-width: 480px) {
  .account-container {
    padding: 0 0.75rem;
  }

  .account-card {
    padding: 1.25rem 1rem;
    margin-bottom: 1rem;
  }

  .account-title {
    font-size: 1.3rem;
  }

  .account-button {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }

  #photo-preview,
  #info-photo {
    width: 120px;
    height: 120px;
  }
}

.g-recaptcha {
  overflow: hidden;
}

@media (max-width: 380px) {
  .g-recaptcha {
    transform: scale(0.85);
    transform-origin: 0 0;
    width: 258px;
  }
}

/* AI usage meters (Claude-style: used / limit bar per generation type) */
.usage-block {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.usage-row .usage-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  margin-bottom: 6px;
}

.usage-row-label { font-weight: 600; }

.usage-row-count { color: #475569; font-variant-numeric: tabular-nums; }
.usage-row-count .usage-row-sub { color: #94a3b8; font-weight: 400; }

.usage-track {
  height: 8px;
  border-radius: 20px;
  background: rgba(15,23,42,0.08);
  overflow: hidden;
}

.usage-fill {
  height: 100%;
  border-radius: 20px;
  background: var(--brand-primary);
  transition: width 0.3s ease;
}

.usage-fill.is-full { background: var(--brand-4); }

.usage-reset {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}

.usage-unlimited {
  font-size: 13px;
  color: #0f766e;
  font-weight: 600;
}

.usage-info-btn {
  align-self: flex-start;
  background: none;
  border: none;
  padding: 0;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-primary);
  cursor: pointer;
  text-decoration: underline;
}

.usage-info {
  font-size: 12.5px;
  line-height: 1.5;
  color: #475569;
  background: rgba(67,176,179,0.06);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 2px;
}