.profile-container {
  max-width: 1000px;
  margin: 0 auto 1rem auto;
  padding: 0 1.5rem 1rem 1.5rem;
}

.profile-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 3.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--ios-primary-dark);
  background-color: var(--ios-bg-primary);
  border-radius: var(--ios-radius-lg);
  padding: var(--ios-spacing-sm);
  margin-bottom: var(--ios-spacing-xl);
  text-align: center;
  box-shadow: var(--ios-shadow-subtle);
}

.avatar-placeholder {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--gray);
  margin: 0 auto 1rem;
  border: 4px solid var(--primary-color);
}

/* ============ */
.profile-section {
  background-color: var(--ios-bg-primary);
  border-radius: var(--ios-radius-lg);
  padding: var(--ios-spacing-xl);
  margin-bottom: var(--ios-spacing-xl);
  box-shadow: var(--ios-shadow-subtle);
}

.section-title {
  color: var(--primary-color);
  margin-bottom: 1.2rem;
  font-size: 1.25rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--ios-spacing-lg);
}

.info-group {
  margin-bottom: 0.8rem;
}

.info-label {
  font-weight: 500;
  color: var(--ios-primary-dark);
  margin-bottom: 0.25rem;
  display: block;
}

.info-value {
  /* color: var(--gray); */
  padding: 0.5rem 0;
  min-height: 1.5rem;
  color: var(--ios-text-primary);
  text-align: left;
}

.info-value.empty {
  color: var(--gray-light);
  font-style: italic;
}

.sacraments-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem 1rem;
  width: 100%;
}

/* Label styling */
.sacraments-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* View/Edit mode styles */
.view-mode .form-control {
  display: none !important;
  border: none;
  background: transparent;
  padding: 0.5rem 0;
  color: var(--gray);
}

.view-mode .radio-group,
.view-mode .form-check {
  display: none !important;
}

.edit-mode .form-control {
  border: 2px solid var(--gray-light);
  background: white;
}

.edit-mode .info-value {
  display: none !important;
}

.view-mode .edit-only {
  display: none !important;
}

.edit-mode .view-only {
  display: none !important;
}

.edit-mode .form-control,
.edit-mode .radio-group,
.edit-mode .form-check {
  display: block !important;
}

.view-mode .info-value {
  display: block;
  color: var(--gray);
  padding: 0.5rem 0;
  min-height: 1.5rem;
}

/* Action buttons */
.profile-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Success message */
.alert-success {
  animation: fadeIn 0.5s ease-in-out;
}

.paragraph {
  white-space: pre-line;
  text-align: justify;
  text-justify: inter-word;
  line-height: 1.7;
  margin-bottom: 1.8em;
  /* text-indent: 1.5em; */
  font-size: 1rem;
  color: #444;
  letter-spacing: 0.02em;
  word-spacing: 0.05em;
}

.subtitle {
  text-align: center;
  font-style: italic;
  /* font-weight: 600; */
  margin: 1.2rem 0;
}

.download-btn {
  padding: 12px 24px;
  background-color: var(--secondary-color);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: background-color 0.3s;
}

.download-btn:hover {
  background-color: #c82333;
}

.download-btn:active {
  transform: scale(0.98);
}

/* age-display.css */
.age-display {
    margin: 10px 0;
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #6c757d;
    font-size: 0.95em;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.age-display:hover {
    background-color: #e9ecef;
    border-left-color: #495057;
}

.age-display strong {
    color: #495057;
    margin-right: 5px;
}

.age-display.error {
  border-left-color: #dc3545;
  background-color: #f8d7da;
  color: #721c24;
}

.age-display.success {
  border-left-color: #28a745;
  background-color: #d4edda;
  color: #155724;
}
/* For form context */
.form-group .age-display {
  margin-top: 8px;
  font-size: 0.9em;
  padding: 8px 12px;
}

/* For profile page context */
.profile-info .age-display {
  margin-top: 15px;
  font-size: 1em;
  padding: 12px 16px;
  background-color: #e7f1ff;
  border-left-color: #007bff;
}

button:disabled,
input[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.field-error {
  color: #dc3545;
  font-size: 0.85rem;
  margin-top: 4px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 768px) {
  .sacraments-group {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .sacraments-group {
    grid-template-columns: 1fr;
  }
}