/**
 * ACCOUNT SETTINGS PAGE — CSS
 * ============================
 * Styles for /account#settings (profile, password, delete account).
 * All classes prefixed `as-` to avoid collisions.
 * Hosted on R2: ld/account-settings.css
 */

/* ── Section Reveal Animation ── */
@keyframes as-section-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Section Cards ── */
.as-section {
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  padding: 28px 28px 24px;
  margin-bottom: 20px;
  transition: box-shadow 0.2s ease;
  opacity: 0;
  animation: as-section-in 0.5s cubic-bezier(.22,.68,0,1) forwards;
}
.as-section:nth-child(1) { animation-delay: 0s; }
.as-section:nth-child(2) { animation-delay: 0.1s; }
.as-section:nth-child(3) { animation-delay: 0.2s; }
.as-section:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04);
}
.as-section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.as-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f0f0f;
  margin: 0;
  letter-spacing: -0.01em;
}

/* ── Profile — Read-Only View ── */
.as-profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 28px;
}
.as-field {
  min-width: 0;
}
.as-field-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}
.as-field-value {
  font-size: 0.9rem;
  color: #1a1a1a;
  word-break: break-word;
  line-height: 1.5;
  font-weight: 500;
}
.as-field-value.muted {
  color: #b0b0b0;
  font-style: italic;
  font-weight: 400;
}
.as-field-full {
  grid-column: 1 / -1;
}

/* Area tags in read-only mode */
.as-area-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.as-area-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: #f5f5f4;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #374151;
  letter-spacing: 0.01em;
}

/* ── Edit / Save Buttons ── */
.as-edit-btn {
  padding: 7px 18px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1a1a1a;
  cursor: pointer;
  transition: all 0.15s ease;
}
.as-edit-btn:hover {
  border-color: #1a1a1a;
  background: #fafafa;
}
.as-save-row {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}
.as-save-btn {
  padding: 11px 28px;
  background: #0f0f0f;
  color: #fff;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(.22,.68,0,1);
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.as-save-btn:hover {
  background: #262626;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.as-save-btn:disabled {
  background: #d1d5db;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.as-cancel-btn {
  padding: 11px 22px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: #1a1a1a;
  cursor: pointer;
  transition: all 0.15s ease;
}
.as-cancel-btn:hover {
  border-color: #1a1a1a;
  background: #fafafa;
}

/* ── Profile — Edit Mode ── */
@keyframes as-edit-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.as-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
  animation: as-edit-in 0.35s cubic-bezier(.22,.68,0,1) both;
}
.as-edit-field {
  min-width: 0;
}
.as-edit-field.full {
  grid-column: 1 / -1;
}
.as-edit-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.as-edit-input,
.as-edit-select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e5e5e5;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.88rem;
  color: #1a1a1a;
  background: #fff;
  transition: all 0.15s ease;
  box-sizing: border-box;
}
.as-edit-input:focus,
.as-edit-select:focus {
  outline: none;
  border-color: #0f0f0f;
  box-shadow: 0 0 0 3px rgba(15,15,15,.06);
}
.as-edit-input::placeholder {
  color: #b0b0b0;
}
.as-edit-input[readonly] {
  background: #fafaf9;
  color: #6b7280;
  cursor: not-allowed;
  border-color: #f0f0ef;
}
.as-edit-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23999' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.as-edit-hint {
  font-size: 0.74rem;
  color: #9ca3af;
  margin-top: 4px;
  line-height: 1.4;
}

/* Area picker */
.as-area-picker {
  position: relative;
}
.as-area-dd {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1.5px solid #e5e5e5;
  border-radius: 0 0 10px 10px;
  border-top: none;
  z-index: 10;
  display: none;
  box-shadow: 0 12px 32px rgba(0,0,0,.1);
}
.as-area-dd.open {
  display: block;
}
.as-area-group {
  border-bottom: 1px solid #f5f5f4;
}
.as-area-group:last-child {
  border-bottom: none;
}
.as-area-muni {
  padding: 10px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #1a1a1a;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.12s ease;
}
.as-area-muni:hover {
  background: #f9f9f8;
}
.as-area-muni.sel {
  background: #0f0f0f;
  color: #fff;
}
.as-area-nb {
  padding: 8px 14px 8px 32px;
  font-size: 0.8rem;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.12s ease;
}
.as-area-nb:hover {
  background: #f9f9f8;
}
.as-area-nb.sel {
  background: #262626;
  color: #fff;
}
.as-area-cb {
  width: 15px;
  height: 15px;
  border: 1.5px solid #d1d5db;
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  font-size: 10px;
}
.sel .as-area-cb {
  background: #0f0f0f;
  border-color: #0f0f0f;
  color: #fff;
}
.sel .as-area-cb::after {
  content: "\2713";
}
.as-edit-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.as-edit-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: #f5f5f4;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #374151;
}
.as-edit-tag-x {
  cursor: pointer;
  opacity: 0.4;
  font-size: 0.85rem;
  line-height: 1;
  transition: opacity 0.15s;
}
.as-edit-tag-x:hover {
  opacity: 1;
}

/* ── Password Section ── */
.as-pw-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: #1a1a1a;
  cursor: pointer;
  transition: color 0.15s ease;
}
.as-pw-toggle:hover {
  color: #4b5563;
}
.as-pw-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform 0.25s cubic-bezier(.22,.68,0,1);
}
.as-pw-toggle.open svg {
  transform: rotate(90deg);
}
.as-pw-form {
  margin-top: 0;
  max-width: 400px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s cubic-bezier(.22,.68,0,1), opacity 0.3s ease, margin-top 0.3s ease;
}
.as-pw-form.open {
  max-height: 400px;
  opacity: 1;
  margin-top: 18px;
}
.as-pw-field {
  margin-bottom: 14px;
}

/* ── Danger Zone ── */
.as-danger {
  border-color: #fee2e2;
}
.as-danger .as-section-title {
  color: #dc2626;
}
.as-danger-desc {
  font-size: 0.86rem;
  color: #6b7280;
  margin-bottom: 18px;
  line-height: 1.6;
}
.as-delete-btn {
  padding: 11px 22px;
  background: #fff;
  color: #dc2626;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  border: 1px solid #fecaca;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.as-delete-btn:hover {
  background: #fef2f2;
  border-color: #dc2626;
}

/* ── Delete Confirmation Modal ── */
.as-modal-ov {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(8px) saturate(180%);
  -webkit-backdrop-filter: blur(8px) saturate(180%);
  z-index: 10020;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.as-modal-ov.open {
  opacity: 1;
  visibility: visible;
}
.as-modal {
  background: #fff;
  border-radius: 18px;
  width: 420px;
  max-width: 94vw;
  padding: 32px;
  transform: scale(0.95) translateY(16px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(.22,.68,0,1), opacity 0.25s ease;
  box-shadow: 0 24px 80px rgba(0,0,0,.15);
}
.as-modal-ov.open .as-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.as-modal h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #dc2626;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.as-modal p {
  font-size: 0.86rem;
  color: #6b7280;
  line-height: 1.6;
  margin: 0 0 18px;
}
.as-modal-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e5e5e5;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.88rem;
  color: #1a1a1a;
  box-sizing: border-box;
  margin-bottom: 18px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.as-modal-input:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,.08);
}
.as-modal-btns {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.as-modal-cancel {
  padding: 11px 22px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: #1a1a1a;
  cursor: pointer;
  transition: all 0.15s ease;
}
.as-modal-cancel:hover {
  border-color: #1a1a1a;
  background: #fafafa;
}
.as-modal-confirm {
  padding: 11px 22px;
  background: #dc2626;
  color: #fff;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(.22,.68,0,1);
  box-shadow: 0 1px 3px rgba(220,38,38,.2);
}
.as-modal-confirm:hover {
  background: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220,38,38,.25);
}
.as-modal-confirm:disabled {
  background: #d1d5db;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Loading Skeleton ── */
@keyframes as-skel-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.as-skel-section {
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.06);
  padding: 28px;
  margin-bottom: 20px;
  animation: as-skel-in 0.4s cubic-bezier(.22,.68,0,1) both;
}
.as-skel-section:nth-child(2) { animation-delay: 0.08s; }
.as-skel-section:nth-child(3) { animation-delay: 0.16s; }
.as-skel-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(110deg, #f5f5f4 30%, #ebebea 50%, #f5f5f4 70%);
  background-size: 250% 100%;
  animation: as-shimmer 1.8s ease-in-out infinite;
  margin-bottom: 14px;
}
.as-skel-line:nth-child(1) { width: 30%; height: 16px; }
.as-skel-line:nth-child(2) { width: 60%; margin-top: 22px; animation-delay: 0.1s; }
.as-skel-line:nth-child(3) { width: 45%; animation-delay: 0.15s; }
.as-skel-line:nth-child(4) { width: 70%; animation-delay: 0.2s; }
.as-skel-line:nth-child(5) { width: 35%; animation-delay: 0.25s; }

@keyframes as-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Error / Message States ── */
.as-msg {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.84rem;
  margin-bottom: 16px;
  font-weight: 500;
  line-height: 1.5;
}
.as-msg-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fee2e2;
}
.as-msg-success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #dcfce7;
}

/* ── Responsive ── */
@media (max-width: 767px) {
  .as-section {
    padding: 20px 18px;
  }
  .as-profile-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .as-edit-grid {
    grid-template-columns: 1fr;
  }
  .as-section-hdr {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .as-modal {
    margin: 0 16px;
    padding: 24px;
  }
}
