/* Fatiha Marriage - Profile Edit Form */

:root {
  --primary: #3d2a7f;
  --primary-light: #5a42a6;
  --primary-dark: #2d1e5f;
  --accent: #f3f1f9;
  --bg: #f8f7fc;
  --card-bg: #ffffff;
  --text: #333333;
  --text-light: #666666;
  --border: #e0e0e0;
  --error: #c44536;
  --success: #3d2a7f;
  --warning-bg: #fff8e6;
  --warning-border: #f0d78c;
  --radius: 10px;
}

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

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

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

/* Header */
header {
  background: linear-gradient(135deg, #3d2a7f 0%, #5a42a6 100%);
  padding: 30px;
  border-radius: var(--radius) var(--radius) 0 0;
  text-align: center;
  margin-bottom: 0;
}

header h1 {
  color: white;
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
}

/* Loading State */
.loading {
  text-align: center;
  padding: 60px 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--accent);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error State */
.error {
  background: #fdf2f2;
  border: 1px solid #f5c6c6;
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
}

.error h2 {
  color: var(--error);
  margin-bottom: 10px;
}

.error p {
  color: var(--text-light);
}

.help-text {
  font-size: 0.9rem;
  margin-top: 15px;
}

/* Success State */
.success {
  background: var(--accent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 30px;
  text-align: center;
}

.success-icon {
  width: 60px;
  height: 60px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 20px;
}

.success h2 {
  color: var(--primary);
  margin-bottom: 10px;
}

/* Form */
form {
  background: var(--card-bg);
  border-radius: 0 0 var(--radius) var(--radius);
  border: 1px solid var(--border);
  border-top: none;
  padding: 30px;
}

.profile-header {
  background: var(--accent);
  border-left: 4px solid var(--primary);
  border-radius: 0 8px 8px 0;
  padding: 15px 20px;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.profile-ref {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--primary);
}

.profile-name {
  font-weight: 400;
  color: var(--text-light);
  font-size: 0.95rem;
}

section {
  margin-bottom: 30px;
}

section h2 {
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.field {
  margin-bottom: 18px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.field-row.thirds {
  grid-template-columns: 1fr 1fr 1fr;
}

.field-row .field {
  margin-bottom: 18px;
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

input[type="text"],
input[type="tel"],
input[type="number"],
input[type="email"],
input[type="date"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s ease;
  background-color: #fff;
}

/* Modern select styling */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

input[type="text"]:hover,
input[type="tel"]:hover,
input[type="number"]:hover,
input[type="email"]:hover,
input[type="date"]:hover,
textarea:hover,
select:hover {
  border-color: var(--primary-light);
}

/* Modern date input */
input[type="date"] {
  cursor: pointer;
  color-scheme: light;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(61, 42, 127, 0.15);
}

/* Placeholder styling */
input::placeholder,
textarea::placeholder {
  color: #aaa;
}

/* Number input - hide spinners */
input[type="number"] {
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

.hint {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 4px;
  font-weight: 400;
}

label > .hint {
  display: inline;
  margin-top: 0;
  margin-left: 4px;
}

/* Checkbox groups for multi-select fields */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fafafa;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.checkbox-label:hover {
  border-color: var(--primary);
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.checkbox-label:has(input:checked) {
  background: var(--accent);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 500;
}

.checkbox-label:has(input:disabled) {
  opacity: 0.5;
  cursor: not-allowed;
}

.checkbox-label:has(input:disabled):hover {
  border-color: var(--border);
}

.char-count {
  text-align: right;
}

/* Form Actions */
.form-actions {
  margin-top: 30px;
}

button[type="submit"] {
  width: 100%;
  padding: 14px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

button[type="submit"]:hover {
  background: var(--primary-light);
}

button[type="submit"]:disabled {
  background: var(--text-light);
  cursor: not-allowed;
}

.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-loading::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.note {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text);
  margin-top: 20px;
  line-height: 1.5;
}

/* Footer */
footer {
  text-align: center;
  padding: 20px;
  color: #888;
  font-size: 13px;
}

footer p {
  margin: 5px 0;
}

footer a {
  color: var(--primary);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Utility */
.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 15px;
  }

  header {
    padding: 20px 0;
  }

  header h1 {
    font-size: 1.5rem;
  }

  form {
    padding: 20px;
  }

  .profile-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .field-row,
  .field-row.thirds {
    grid-template-columns: 1fr;
  }
}
