/* NauticalNinja — Auth Styles
   Login/signup modal, profile forms, OAuth buttons */

/* ── Modal backdrop & container ───────────────────────────── */
.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-modal {
  background: #fff;
  border-radius: 12px;
  padding: 32px 28px;
  max-width: 400px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-height: 90vh;
  overflow-y: auto;
}

.auth-modal__close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 22px;
  color: #999;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.auth-modal__close:hover { color: #333; }

.auth-modal__title {
  margin: 0 0 4px;
  font-size: 20px;
  color: #1a2a44;
}
.auth-modal__subtitle {
  margin: 0 0 20px;
  font-size: 13px;
  color: #666;
}

/* ── Tabs ─────────────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid #e8ecf1;
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 10px 0;
  font-size: 15px;
  font-weight: 600;
  color: #999;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.auth-tab:hover { color: #555; }
.auth-tab.active {
  color: #1a2a44;
  border-bottom-color: #1a2a44;
}

/* ── Form fields ──────────────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #444;
  margin-bottom: 4px;
}

.auth-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  background: #fff;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.auth-field input:focus {
  outline: none;
  border-color: #1a2a44;
  box-shadow: 0 0 0 3px rgba(26, 42, 68, 0.1);
}
.auth-field input.auth-input--disabled {
  background: #f5f5f5;
  color: #999;
}
.auth-hint {
  font-weight: 400;
  font-size: 11px;
  color: #999;
}
.auth-field .auth-hint {
  display: block;
  margin-top: 4px;
}
.auth-btn--secondary {
  background: #475569;
}
.auth-btn--secondary:hover {
  background: #5a6a7e;
}

/* ── Buttons ──────────────────────────────────────────────── */
.auth-btn-primary {
  width: 100%;
  padding: 11px;
  background: #1a2a44;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 4px;
}
.auth-btn-primary:hover { background: #253a5a; }
.auth-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── OAuth buttons ────────────────────────────────────────── */
.auth-btn-oauth {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 8px;
}

.auth-btn-google {
  background: #fff;
  border: 1px solid #d0d5dd;
  color: #333;
}
.auth-btn-google:hover { background: #f8f9fa; }

.auth-btn-apple {
  background: #000;
  border: 1px solid #000;
  color: #fff;
}
.auth-btn-apple:hover { background: #222; }

/* ── Divider ──────────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: #aaa;
  font-size: 13px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e0e4ea;
}

/* ── Links ────────────────────────────────────────────────── */
.auth-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  color: #1a2a44;
  text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }

/* ── Error / Success messages ─────────────────────────────── */
.auth-error {
  background: #fef2f2;
  color: #dc2626;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 8px;
}

.auth-success {
  background: #f0fdf4;
  color: #16a34a;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 8px;
}

/* ── Topnav account area ──────────────────────────────────── */
.topnav__account {
  display: flex;
  align-items: center;
  margin-left: auto;
  margin-right: 8px;
}

.topnav__login-btn {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.topnav__login-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.topnav__user-menu {
  position: relative;
}

.topnav__user-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.4);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
}
.topnav__user-btn:hover { opacity: 0.85; }

.topnav__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  min-width: 180px;
  z-index: 1000;
  overflow: hidden;
}
.topnav__dropdown.open { display: block; }

.topnav__dropdown-header {
  padding: 12px 16px;
  font-weight: 600;
  font-size: 14px;
  color: #1a2a44;
  border-bottom: 1px solid #f0f0f0;
}

.topnav__dropdown a {
  display: block;
  padding: 10px 16px;
  color: #444;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.1s;
}
.topnav__dropdown a:hover {
  background: #f5f7fa;
}

/* ── Profile Rows ────────────────────────────────────────── */
.profile-rows {
  margin-top: 16px;
}
.profile-row {
  display: flex;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
  gap: 12px;
}
.profile-row:last-child { border-bottom: none; }
.profile-row__label {
  font-size: 13px;
  font-weight: 600;
  color: #666;
  width: 100px;
  flex-shrink: 0;
}
.profile-row__value {
  flex: 1;
  font-size: 14px;
  color: #1a2a44;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-row__action {
  background: none;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  color: #666;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}
.profile-row__action:hover { border-color: #1a2a44; color: #1a2a44; }
.profile-row__edit {
  flex: 1;
  display: flex;
  gap: 6px;
  align-items: center;
}
.profile-row__input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  font-size: 13px;
  min-width: 0;
}
.profile-row__input:focus {
  outline: none;
  border-color: #1a2a44;
}
.profile-row__save {
  background: #1a2a44;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.profile-row__save:hover { background: #253a5a; }
.profile-row__cancel {
  background: none;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  color: #666;
  cursor: pointer;
}

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .auth-modal {
    padding: 24px 20px;
    margin: 10px;
  }

  .topnav__account {
    margin-right: 4px;
  }

  .topnav__login-btn {
    padding: 5px 12px;
    font-size: 12px;
  }

  .topnav__user-btn {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }
}

/* ─── Dark Theme Overrides ──────────────────────────────────────────────── */
[data-theme="dark"] .auth-modal        { background: #1e2c3f; color: #c8d8e8; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
[data-theme="dark"] .auth-modal__title { color: #c8d8e8; }
[data-theme="dark"] .auth-modal__subtitle { color: #98afc4; }
[data-theme="dark"] .auth-modal__close { color: #7a8fa8; }
[data-theme="dark"] .auth-modal__close:hover { color: #c8d8e8; }
[data-theme="dark"] .auth-tabs         { border-color: #2d3d4a; }
[data-theme="dark"] .auth-tab          { color: #7a8fa8; }
[data-theme="dark"] .auth-tab:hover    { color: #98afc4; }
[data-theme="dark"] .auth-tab.active   { color: #89b4d4; border-color: #89b4d4; }
[data-theme="dark"] .auth-field label  { color: #98afc4; }
[data-theme="dark"] .auth-field input  { background: #243347; border-color: #3d4f5e; color: #c8d8e8; }
[data-theme="dark"] .auth-field input:focus { border-color: #4a7fa5; box-shadow: 0 0 0 3px rgba(74,127,165,0.2); }
[data-theme="dark"] .auth-field input.auth-input--disabled { background: #1a2536; color: #556272; }
[data-theme="dark"] .auth-btn-google   { background: #243347; border-color: #3d4f5e; color: #c8d8e8; }
[data-theme="dark"] .auth-btn-google:hover { background: #2d3d4a; }
[data-theme="dark"] .auth-divider      { color: #556272; }
[data-theme="dark"] .auth-divider::before,
[data-theme="dark"] .auth-divider::after { background: #2d3d4a; }
[data-theme="dark"] .auth-link         { color: #89b4d4; }
[data-theme="dark"] .auth-error        { background: #2a1010; color: #f87171; border-color: #5a1a1a; }
[data-theme="dark"] .auth-success      { background: #132d2a; color: #4ade80; border-color: #1a4a3a; }

[data-theme="dark"] .topnav__dropdown  { background: #1e2c3f; box-shadow: 0 8px 30px rgba(0,0,0,0.5); border: 1px solid #2d3d4a; }
[data-theme="dark"] .topnav__dropdown-header { color: #89b4d4; border-color: #2d3d4a; }
[data-theme="dark"] .topnav__dropdown a { color: #c8d8e8; }
[data-theme="dark"] .topnav__dropdown a:hover { background: #243347; color: #e8f0f8; }
[data-theme="dark"] .profile-row        { border-color: #2d3d4a; }
[data-theme="dark"] .profile-row__label { color: #7a8fa8; }
[data-theme="dark"] .profile-row__value { color: #c8d8e8; }
[data-theme="dark"] .profile-row__action { border-color: #3d4f5e; color: #98afc4; }
[data-theme="dark"] .profile-row__action:hover { color: #c8d8e8; border-color: #89b4d4; }
[data-theme="dark"] .profile-row__input { border-color: #3d4f5e; background: #243347; color: #c8d8e8; }
[data-theme="dark"] .profile-row__save  { background: #2d5a80; color: #e8f0f8; }
[data-theme="dark"] .profile-row__save:hover { background: #3d6a90; }
[data-theme="dark"] .profile-row__cancel { border-color: #3d4f5e; color: #98afc4; }
