/* ============================================================
   Ozona Consulting — Internal portal styles
   ============================================================ */

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

:root {
  --brand:        #ce2558;
  --brand-dark:   #b01f4a;
  --black:        #000000;
  --text:         #1f2937;
  --text-light:   #6b7280;
  --border:       #e5e7eb;
  --bg:           #f5f5f5;
  --surface:      #ffffff;
  --white:        #ffffff;
  --radius:       6px;
  --footer-size:  11px;
}

/* Dark mode overrides */
[data-theme="dark"] {
  --text:       #f3f4f6;
  --text-light: #9ca3af;
  --border:     #374151;
  --bg:         #111827;
  --surface:    #1f2937;
  --white:      #1f2937;
}
[data-theme="dark"] body      { background: var(--bg); }
[data-theme="dark"] #container { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .project-card { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .project-card:hover { box-shadow: 0 2px 10px rgba(206,37,88,.15); }
[data-theme="dark"] .user-dropdown { background: var(--surface); border-color: var(--border); box-shadow: 0 4px 20px rgba(0,0,0,.4); }
[data-theme="dark"] .dropdown-item:hover { background: #374151; }
[data-theme="dark"] .input-field { background: #374151; border-color: #4b5563; color: var(--text); }
[data-theme="dark"] .otp-box { background: #374151; border-color: #4b5563; color: var(--text); }
[data-theme="dark"] body.auth-page { background: #0d1117; }
[data-theme="dark"] body.auth-page #container { box-shadow: 0 4px 24px rgba(0,0,0,.4); }
[data-theme="dark"] .flash-error   { background: #4a0011; border-color: #9f1239; color: #fca5a5; }
[data-theme="dark"] .flash-success { background: #052e16; border-color: #166534; color: #86efac; }
[data-theme="dark"] .flash-info    { background: #1e3a5f; border-color: #1e40af; color: #93c5fd; }
[data-theme="dark"] .profile-card  { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .avatar-placeholder { background: #374151; }
[data-theme="dark"] .theme-swatch-light { background: #f9fafb; color: #1f2937; }
[data-theme="dark"] .btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
[data-theme="dark"] .error-debug   { background: #1f2937; border-color: var(--border); }
[data-theme="dark"] .error-debug pre { background: #111827; border-color: var(--border); color: #d1d5db; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 13px;
  font-weight: 300;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

/* Bebas Neue for headings and project names */
h2, .page-header h2, .auth-card h2, .project-name {
  font-family: 'Bebas Neue', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.04em;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   Layout
   ============================================================ */
#wrapper {
  width: 880px;
  margin: 0 auto;
  padding: 0 0 32px;
}

/* ============================================================
   Site header (black Ozona bar)
   ============================================================ */
#site-header {
  height: 44px;
  background: #000;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
}
#site-header a { display: block; line-height: 0; }
#site-header img { height: 44px; width: auto; display: block; }

/* ============================================================
   Flash messages
   ============================================================ */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 400;
}
.flash-error   { background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; }
.flash-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.flash-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ============================================================
   Container
   ============================================================ */
#container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

#content { padding: 28px 32px; }

/* ============================================================
   Footer + language selector
   ============================================================ */
#footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px 0;
  color: var(--text-light);
  font-size: var(--footer-size);
  flex-wrap: wrap;
  gap: 8px;
}
.footer-copy {
  font-size: var(--footer-size);
  color: var(--text-light);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============================================================
   User menu dropdown
   ============================================================ */
.user-menu { position: relative; }

.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--footer-size);
  color: var(--text);
  font-weight: 400;
  padding: 0;
  line-height: 1;
}

/* Avatar thumbnail in trigger */
.avatar-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}
.user-menu-trigger:hover { color: var(--brand); }
.user-menu-trigger:hover .chevron path { stroke: var(--brand); }

.user-dropdown {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
  min-width: 170px;
  z-index: 200;
  padding: 4px 0;
}
.user-dropdown.open { display: block; }

.dropdown-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-light);
  padding: 8px 12px 4px;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  font-size: 12px;
  color: var(--text);
  text-decoration: none;
  transition: background .1s;
}
.dropdown-item:hover { background: #f9fafb; color: var(--text); text-decoration: none; }
.dropdown-item.active { color: var(--brand); }
.dropdown-item-danger { color: var(--brand); }
.dropdown-lang-code {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-light);
  width: 18px;
}
.dropdown-item.active .dropdown-lang-code { color: var(--brand); }
.dropdown-divider { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

.lang-selector {
  display: flex;
  gap: 6px;
}

.lang-btn {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-light);
  border: 1px solid transparent;
  transition: all .15s;
  text-decoration: none;
}
.lang-btn:hover { border-color: var(--border); color: var(--text); text-decoration: none; }
.lang-btn.active { border-color: var(--brand); color: var(--brand); font-weight: 500; }

/* ============================================================
   Dashboard page
   ============================================================ */
.page-header {
  margin-bottom: 24px;
  padding-bottom: 0;
}
.page-header h2 { font-size: 26px; font-weight: 400; color: var(--text); margin-bottom: 4px; }
.page-subtitle  { font-size: 13px; color: var(--text-light); }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 16px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  text-decoration: none;
  color: inherit;
  position: relative;
}
.project-card:hover {
  border-color: var(--brand);
  box-shadow: 0 2px 10px rgba(229,0,70,.08);
  text-decoration: none;
}

.project-icon { line-height: 0; margin-bottom: 8px; display: flex; justify-content: center; }

.project-name {
  font-size: 20px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.3;
  text-align: center;
}
.project-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-light);
  flex-wrap: wrap;
  margin-top: auto;
}
.project-dev {
  display: flex;
  align-items: center;
  gap: 3px;
}
.project-dev::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  background: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='8' cy='5' r='3' fill='%23ce2558'/%3E%3Cpath d='M2 15c0-3.314 2.686-5 6-5s6 1.686 6 5' stroke='%23ce2558' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center;
  flex-shrink: 0;
}
.project-status {
  background: #fff0f3;
  color: #c20038;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 400;
  border: 1px solid #ffd6e0;
}
.project-status-available {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.project-arrow {
  position: absolute;
  top: 14px;
  right: 14px;
  color: var(--brand);
  font-size: 14px;
  opacity: .5;
  transition: opacity .15s;
}
.project-card:hover .project-arrow { opacity: 1; }

/* ============================================================
   Auth pages
   ============================================================ */
body.auth-page {
  background: #f0f0f0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

body.auth-page #wrapper {
  width: 100%;
  max-width: 440px;
  padding: 40px 16px 24px;
}

body.auth-page #container {
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,.07);
}

.auth-shell { padding: 0; }

.auth-card {
  padding: 36px 36px 28px;
  text-align: center;
}

.auth-logo { margin-bottom: 18px; display: flex; justify-content: center; }

.auth-card h2 {
  font-size: 22px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 10px;
  white-space: nowrap;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 24px;
}

.form-group { text-align: left; margin-bottom: 14px; }

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-light);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-field {
  display: block;
  width: 100%;
  height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 300;
  color: var(--text);
  background: var(--white);
  transition: border-color .15s;
  -webkit-appearance: none;
}
.input-field:focus { outline: none; border-color: var(--brand); }

/* OTP individual boxes */
.otp-group {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 16px 0 4px;
}
.otp-box {
  width: 46px;
  height: 54px;
  text-align: center;
  font-size: 24px;
  font-weight: 500;
  font-family: monospace;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
  caret-color: var(--brand);
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
.otp-box:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(229,0,70,.08);
}
.otp-box:not(:placeholder-shown) { border-color: var(--brand); }

.btn-primary {
  display: block;
  width: 100%;
  height: 44px;
  margin-top: 18px;
  background: var(--black);
  color: var(--white);
  border: none;
  border-radius: 24px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 300;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
  line-height: 44px;
  text-align: center;
  -webkit-appearance: none;
}
.btn-primary:hover { background: var(--brand-dark); color: var(--white); text-decoration: none; }

.auth-note {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.6;
}
.auth-note a { color: var(--brand); }

/* ============================================================
   Error page
   ============================================================ */
body.error-page #content { padding: 48px 40px; }
.error-shell { text-align: center; }
.error-code { font-size: 72px; font-weight: 100; color: var(--brand); line-height: 1; margin-bottom: 8px; }
.error-shell h2 { font-size: 22px; font-weight: 300; color: var(--text); margin-bottom: 10px; }
.error-message { font-size: 14px; color: var(--text-light); margin-bottom: 28px; }
.error-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.error-actions .btn-primary { display: inline-block; width: auto; padding: 0 28px; }
.btn-secondary {
  display: inline-block; height: 44px; padding: 0 24px;
  background: var(--white); color: var(--text);
  border: 1px solid var(--border); border-radius: 24px;
  font-family: inherit; font-size: 13px; font-weight: 300;
  cursor: pointer; transition: border-color .15s;
  text-decoration: none; line-height: 44px;
}
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.error-debug { margin: 20px auto; max-width: 600px; text-align: left; background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.error-debug summary { cursor: pointer; font-size: 12px; color: var(--text-light); margin-bottom: 10px; }
.error-debug pre { font-size: 11px; color: #374151; white-space: pre-wrap; word-break: break-all; background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 10px; margin-bottom: 10px; }
.debug-table { width: 100%; font-size: 11px; border-collapse: collapse; }
.debug-table th, .debug-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.debug-table th { width: 110px; color: var(--text-light); font-weight: 400; white-space: nowrap; }
.debug-table td { font-family: monospace; word-break: break-all; }

/* ============================================================
   Profile page
   ============================================================ */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 560px;
}

.profile-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 20px 18px;
}

.profile-card-title {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-light);
  margin-bottom: 16px;
}

/* Avatar preview */
.avatar-preview-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.avatar-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #f3f4f6;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* File upload label styled as button */
.profile-form { text-align: center; }

.file-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.file-label:hover { border-color: var(--brand); color: var(--brand); }

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.profile-hint {
  font-size: 10px;
  color: var(--text-light);
  margin-top: 8px;
}

/* Theme selector */
.theme-options {
  display: flex;
  gap: 10px;
}

.theme-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-light);
  transition: border-color .15s, color .15s;
  user-select: none;
}
.theme-option input { display: none; }
.theme-option:hover { border-color: var(--brand); color: var(--text); }
.theme-option.selected { border-color: var(--brand); color: var(--brand); }

.theme-swatch {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}

.theme-swatch-light { background: #f9fafb; color: #6b7280; border: 1px solid #e5e7eb; }
.theme-swatch-dark  { background: #1f2937; color: #9ca3af; }
.theme-option.selected .theme-swatch-light { color: var(--brand); }
.theme-option.selected .theme-swatch-dark  { color: #f3f4f6; }

/* Small utility buttons */
.btn-sm {
  height: 36px;
  font-size: 12px;
  border-radius: 18px;
  margin-top: 12px !important;
  width: 100%;
}

.btn-ghost-danger {
  display: inline-block;
  background: none;
  border: 1px solid transparent;
  color: var(--brand);
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background .15s;
}
.btn-ghost-danger:hover { background: #fff0f3; }

.back-link {
  font-size: 12px;
  color: var(--text-light);
}
.back-link:hover { color: var(--brand); }

/* ============================================================
   Responsive — tablet
   ============================================================ */
@media (max-width: 920px) {
  #wrapper { width: auto; padding: 0 16px 24px; }
  #site-header { border-radius: 0; }
  #content { padding: 20px 20px; }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .project-card .project-name { font-size: 12px; }
}

/* ============================================================
   Responsive — mobile
   ============================================================ */
@media (max-width: 600px) {
  body.auth-page #wrapper { padding: 16px 12px 20px; }

  .auth-card { padding: 28px 20px 24px; }
  .auth-card h2 { font-size: 16px; white-space: normal; }

  .input-code { font-size: 22px; letter-spacing: 6px; }

  .projects-grid { grid-template-columns: 1fr; }
  .project-card { padding: 14px 14px; }
  .profile-grid { grid-template-columns: 1fr; }

  #content { padding: 18px 16px; }

  body.error-page #content { padding: 32px 20px; }
  .error-code { font-size: 56px; }

  #footer { flex-direction: column; align-items: flex-start; gap: 10px; }
  .footer-right { flex-direction: column; align-items: flex-start; gap: 8px; }
}
