/* Modern Account Settings Design - Inspired by Facebook Settings */
/* Color scheme: Clean white/light gray with blue accents */

:root {
  --primary: #0a66c2;
  --primary-light: #e7f3ff;
  --primary-dark: #003d82;
  --bg-primary: #ffffff;
  --bg-secondary: #f0f2f5;
  --bg-tertiary: #e4e6eb;
  --text-primary: #050505;
  --text-secondary: #65676b;
  --text-tertiary: #8a8d91;
  --border-color: #ccc;
  --border-light: #e5e7eb;
  --border-heavy: #d0d2d7;
  --success: #22c55e;
  --warning: #f97316;
  --danger: #ef4444;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header / Top Navigation */
header {
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 20px;
  color: var(--primary);
  text-decoration: none;
}

header .brand span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #0052a3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
}

header .user-info {
  color: var(--text-secondary);
  font-size: 13px;
  padding-right: 12px;
  border-right: 1px solid var(--border-light);
}

header .user-info strong {
  color: var(--text-primary);
}

/* Main Layout Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.container-with-sidebar {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

@media (max-width: 768px) {
  .container-with-sidebar {
    grid-template-columns: 1fr;
    padding: 16px;
  }
}

/* Sidebar Navigation */
aside {
  position: sticky;
  top: 64px;
  height: fit-content;
}

aside nav {
  background-color: var(--bg-primary);
  border-radius: 8px;
  border: 1px solid var(--border-light);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

aside nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 15px;
  border-left: 3px solid transparent;
  transition: var(--transition);
  position: relative;
}

aside nav a:hover {
  background-color: var(--bg-secondary);
  color: var(--primary);
}

aside nav a.active {
  background-color: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}

aside nav a svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Page Title and Breadcrumb */
.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--text-primary);
}

.page-header p {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span {
  color: var(--text-tertiary);
}

/* Cards and Sections */
.card, section {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card.highlight {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

section h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 16px 0;
  color: var(--text-primary);
}

section h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 16px 0 8px 0;
  color: var(--text-primary);
}

section p {
  margin: 8px 0;
  color: var(--text-secondary);
  font-size: 15px;
}

/* Card Grid Layout */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.card-item {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 20px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.card-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.card-item-icon {
  width: 48px;
  height: 48px;
  background-color: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 24px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.card-item h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--text-primary);
}

.card-item p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 16px 0;
  flex-grow: 1;
}

/* Forms */
form {
  display: flex;
  flex-direction: column;
}

form > * + * {
  margin-top: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: block;
}

label .help {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 4px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="tel"],
input[type="number"],
textarea,
select {
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  font-family: inherit;
  transition: var(--transition);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

input[type="text"]:disabled,
input[type="email"]:disabled,
input[type="password"]:disabled,
input[type="url"]:disabled,
input[type="tel"]:disabled,
input[type="number"]:disabled,
textarea:disabled,
select:disabled {
  background-color: var(--bg-secondary);
  color: var(--text-tertiary);
  cursor: not-allowed;
}

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

/* Buttons */
button, .btn, input[type="submit"] {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  text-align: center;
}

.btn-primary, button[type="submit"], .btn {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover, button[type="submit"]:hover, .btn:hover {
  background-color: var(--primary-dark);
  box-shadow: var(--shadow-md);
}

.btn-primary:active, button[type="submit"]:active, .btn:active {
  transform: scale(0.98);
}

.btn-secondary {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--border-heavy);
}

.btn-danger {
  background-color: var(--danger);
  color: white;
}

.btn-danger:hover {
  background-color: #dc2626;
  box-shadow: var(--shadow-md);
}

.btn-success {
  background-color: var(--success);
  color: white;
}

.btn-success:hover {
  background-color: #16a34a;
  box-shadow: var(--shadow-md);
}

.btn-warning {
  background-color: var(--warning);
  color: white;
}

.btn-warning:hover {
  background-color: #ea580c;
  box-shadow: var(--shadow-md);
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.alert-error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-success {
  background-color: #dcfce7;
  color: #15803d;
  border: 1px solid #bfef45;
}

.alert-warning {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.alert-info {
  background-color: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.alert::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 8px;
  background-color: currentColor;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background-color: var(--primary-light);
  color: var(--primary);
}

.badge.secondary {
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
}

.badge.success {
  background-color: #dcfce7;
  color: #15803d;
}

.badge.warning {
  background-color: #fef3c7;
  color: #92400e;
}

.badge.danger {
  background-color: #fee2e2;
  color: #991b1b;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

thead {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  border-bottom: 2px solid var(--border-light);
}

th {
  padding: 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

td {
  padding: 12px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
  color: var(--text-primary);
}

tbody tr:hover {
  background-color: var(--bg-secondary);
}

/* Account Summary Card */
.account-summary {
  background: linear-gradient(135deg, var(--primary), #0052a3);
  color: white;
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 24px;
}

.account-summary h2 {
  color: white;
  margin-top: 0;
}

.account-summary-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.account-summary-item:last-child {
  border-bottom: none;
}

.account-summary-item strong {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

/* User Avatar */
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}

.avatar.large {
  width: 80px;
  height: 80px;
}

/* Footer */
footer {
  background-color: var(--bg-primary);
  border-top: 1px solid var(--border-light);
  padding: 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 40px;
}

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

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

/* Settings Section Layout */
.settings-section {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

.settings-section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.settings-section-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}

.settings-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.settings-label {
  flex: 1;
}

.settings-label h3 {
  margin: 0 0 4px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.settings-label p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.settings-control {
  flex-shrink: 0;
}

/* Device Info Card */
.device-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.device-info h4 {
  margin: 0 0 8px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.device-info p {
  margin: 4px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.device-action {
  flex-shrink: 0;
}

/* Verification Status */
.verification-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 6px;
  background-color: var(--bg-secondary);
  width: fit-content;
}

.verification-status.verified {
  background-color: #dcfce7;
  color: #15803d;
}

.verification-status.unverified {
  background-color: #fef3c7;
  color: #92400e;
}

.verification-status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
}

/* Modal Dialog */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.open {
  display: flex;
}

.modal-content {
  background-color: var(--bg-primary);
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 16px 0;
  color: var(--text-primary);
}

.modal-body {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Responsive Design */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  header nav {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  header nav a {
    display: block;
    width: 100%;
  }

  .container-with-sidebar {
    grid-template-columns: 1fr;
  }

  aside {
    position: static;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

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

  .settings-control {
    margin-top: 12px;
  }

  .page-header h1 {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  header .brand {
    font-size: 16px;
  }

  .page-header h1 {
    font-size: 20px;
  }

  button, .btn, input[type="submit"] {
    width: 100%;
  }

  table {
    font-size: 12px;
  }

  th, td {
    padding: 8px 4px;
  }
}

/* Utility Classes */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.hidden { display: none; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
