:root {
  --accent: #2f6fed;
  --accent-light: #dbeafe;
  --border: #d6dbe3;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --surface-0: #f8fafc;
  --surface-1: #ffffff;
  --surface-2: #ffffff;
  --radius: 6px;
  --danger: #b3261e;
  --bg: #f4f6f9;
  --text: #1c2333;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 32px 16px;
  font: 15px/1.55 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

@media (max-width: 600px) {
  body { padding: 18px 12px; }
}

/* ------------------------------------------------------------------ */
/* Layout                                                              */
/* ------------------------------------------------------------------ */
.layout {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  height: 100vh;
  padding: 1.25rem 1.5rem;
  overflow: hidden;
}

/* ------------------------------------------------------------------ */
/* Top Bar                                                             */
/* ------------------------------------------------------------------ */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: nowrap;
  flex-shrink: 0;
  margin: 20px;
}

.top-bar h1 {
  font-weight: bold;
  font-size: 26px;
  margin: 0;
  color: var(--text-primary);
  flex-shrink: 0;
}

/* ------------------------------------------------------------------ */
/* Logged-in user                                                      */
/* ------------------------------------------------------------------ */
.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem 0.3rem 0.35rem;
  border: 0.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface-1);
  font-size: 13px;
  color: var(--text-primary);
  max-width: 320px;
  flex-shrink: 0;
}

.user-chip img,
.user-chip .user-avatar-fallback {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}

.user-chip .user-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
}

.user-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.user-card {
  background: var(--surface-1);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  max-width: 640px;
}

.user-card h2 {
  margin: 0 0 0.9rem;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-details {
  display: grid;
  grid-template-columns: minmax(130px, auto) 1fr;
  gap: 0.45rem 1rem;
  margin: 0;
  font-size: 13px;
}

.user-details dt {
  color: var(--text-secondary);
  font-weight: 600;
}

.user-details dd {
  margin: 0;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 52px !important;
  padding: 0 35px !important;
  border: none !important;
  border-radius: 6px !important;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  cursor: pointer;
  margin: 0 !important;
}

.btn-accent {
  background: var(--accent);
  color: #ffffff;
}

.btn-accent:hover { background: #1d4ed8; }
.btn-accent:disabled { background: #93c5fd; cursor: not-allowed; }

.btn-secondary {
  border: 0.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text-primary);
}

.btn-secondary:hover { background: #f1f5f9; }

/* ------------------------------------------------------------------ */
/* Info / error boxes                                                  */
/* ------------------------------------------------------------------ */
.hidden { display: none !important; }

.info-box {
  background: #eff6ff;
  border: 0.5px solid var(--accent-light);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 13px;
}

.error-box {
  background: #fdf2f2;
  border: 0.5px solid #fca5a5;
  color: #7b1d1d;
  border-radius: 8px;
  padding: 0.7rem 1rem;
  font-size: 13px;
  margin-bottom: 0.5rem;
}

.error-text {
  color: var(--danger);
  font-size: 12px;
}

/* ------------------------------------------------------------------ */
/* Loading spinner                                                     */
/* ------------------------------------------------------------------ */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(37, 99, 235, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin-right: 0.5rem;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
.login-container{
  display: flex;
  justify-content: center;
}
.logout-button{
  color: #2864e8;
  background:#e4f1ff;
  margin-right: 5px;
  padding: 10px !important;
  border-radius: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ */
/* Form controls                                                       */
/* ------------------------------------------------------------------ */
h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: -0.2px; }

label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }

input[type="text"],
input[type="email"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  padding: 9px 11px;
  font: inherit;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 7px;
  transition: border-color 0.12s, box-shadow 0.12s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.16);
}

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

input[type="date"],
input[type="time"] { cursor: pointer; }

button {
  padding: 10px 20px;
  font: inherit;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
}

button[disabled] { opacity: 0.6; cursor: not-allowed; }

/* ------------------------------------------------------------------ */
/* Support ticket form                                                 */
/* ------------------------------------------------------------------ */

.ticket-container {
  width: 94% !important;
  max-width: 1140px !important;
  margin: 14px auto 30px !important;
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.header {
  width: 100%;
  background: #2864e8;
  padding: 22px 38px;
  text-align: center;
  color: white;
}

.logo-box {
  width: 150px !important;
  min-width: 150px !important;
  height: 64px;

  background: rgba(255, 255, 255, 0.18);
  border-radius: 5px;

  display: flex;
  align-items: center;
  justify-content: center;

  color: #ffffff;
  font-size: 13px;
}

.logo-box img {
  display: block;
  max-width: 128px;
  max-height: 44px;
  width: 100%;
  height: auto;
  filter: brightness(0) invert(1);
}

.header-title {
  margin: 0 !important;
  padding: 0 !important;

  color: #ffffff !important;
  font-size: 32px !important;
  font-weight: 700 !important;

  line-height: 1.2;
}

.form-content {
  width: 100%;
  padding: 35px 65px !important;
}

.info-message {
  width: 100%;

  background: #eef6ff;

  border-left: 5px solid #2864e8;

  border-radius: 5px;

  padding: 18px 19px;

  margin: 0 0 28px 0;

  font-size: 15px;
  line-height: 1.5;

  color: #16385f;
}

.info-message strong {
  font-weight: 700;
}

.section {
  width: 100%;
  margin: 0 0 48px 0;
}

.section-title {
  width: 100%;

  margin: 0 0 26px 0 !important;
  padding: 0 0 15px 0 !important;

  color: #2864e8 !important;

  font-size: 23px !important;
  font-weight: 600 !important;

  line-height: 1.2;

  border-bottom: 2px solid #f15a3a;
}

.form-row {
  width: 100%;

  display: grid !important;

  grid-template-columns:
    calc(50% - 12px) calc(50% - 12px) !important;

  column-gap: 24px !important;

  row-gap: 0 !important;

  margin: 0 0 26px 0 !important;

  padding: 0 !important;
}

.form-row.single {
  display: block !important;

  width: 100% !important;

  margin-bottom: 26px !important;
}

.form-group {
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.form-label {
  display: block !important;

  width: 100%;

  margin: 0 0 10px 0 !important;
  padding: 0 !important;

  color: #10385f !important;

  font-size: 15px !important;
  font-weight: 400 !important;

  line-height: 1.4;
}

.required {
  color: #ef3d23 !important;
  font-weight: 600;
}

.form-input {
  display: block !important;

  width: 100% !important;
  height: 54px !important;

  margin: 0 !important;
  padding: 0 15px !important;

  border: 1px solid #d6d6d6 !important;
  border-radius: 5px !important;

  background: #ffffff !important;

  color: #101010 !important;

  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif !important;
  font-size: 15px !important;

  outline: none !important;

  box-shadow: none;
}

.form-input[readonly] {
  background: #e4f1ff !important;
}

.form-input::placeholder {
  color: #9b9b9b !important;
  opacity: 1;
}

.form-input:focus {
  border-color: #2864e8 !important;

  box-shadow:
    0 0 0 2px rgba(40, 100, 232, 0.10) !important;
}

.was-submitted .form-input:invalid,
.was-submitted .form-textarea:invalid,
.field-invalid {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.12) !important;
}

.field-error {
  display: none;
  margin: 7px 0 0;
  color: #b91c1c;
  font-size: 13px;
}

.field-error.visible {
  display: block;
}

.form-textarea {
  display: block !important;

  width: 100% !important;

  min-height: 125px !important;

  margin: 0 !important;
  padding: 15px !important;

  border: 1px solid #d6d6d6;
  border-radius: 5px !important;

  background: #ffffff !important;

  color: #101010 !important;

  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif !important;
  font-size: 15px !important;

  outline: none !important;

  resize: vertical;
}

.form-textarea::placeholder {
  color: #9b9b9b !important;
  opacity: 1;
}

.form-textarea:focus {
  border-color: #2864e8 !important;

  box-shadow:
    0 0 0 2px rgba(40, 100, 232, 0.10) !important;
}

/*
   Date & time: do NOT add emoji/icon. Browser already displays one.
*/
input[type="date"].form-input,
input[type="time"].form-input {
  padding-right: 12px !important;
}

.input-icon {
  display: none !important;
}

.button-container {
  width: 100%;

  display: flex !important;

  justify-content: flex-end !important;

  align-items: center;

  gap: 15px !important;

  margin: 42px 0 0 0 !important;
  padding: 0 !important;
}

.btn-clear {
  background: #eeeeee !important;
  color: #52606d !important;
}

.btn-clear:hover {
  background: #e2e2e2 !important;
}

.btn-submit {
  background: #2864e8 !important;
  color: #ffffff !important;
}

.btn-submit:hover {
  background: #1e55ce !important;
}

.success-view {
  width: 100%;
  padding: 70px 65px 170px 65px !important;
  text-align: center;
}

.success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: #63ba73;
  color: #ffffff;
  font-size: 30px;
  line-height: 64px;
}

.success-title {
  margin: 0 0 10px 0;
  font-size: 24px;
  font-weight: 700;
  color: #16385f;
}

.success-question {
  margin: 0 0 28px 0;
  font-size: 15px;
  color: #52606d;
}

.auth-loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #52606d;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
}

.logo-sp{
  width: 120px;
    height: 50px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

@media screen and (max-width: 768px) {

  .ticket-container {
    width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }

  .header {
    min-height: auto;

    padding: 25px !important;

    flex-direction: column;
    align-items: flex-start;

    gap: 20px;
  }

  .header-title {
    font-size: 30px !important;
  }

  .form-content {
    padding: 30px 25px !important;
  }

  .form-row {
    display: block !important;

    width: 100% !important;

    margin-bottom: 20px !important;
  }

  .form-row .form-group {
    width: 100% !important;

    margin-bottom: 20px !important;
  }

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

  .button-container {
    flex-direction: column-reverse !important;

    align-items: stretch !important;

    width: 100%;
  }

  .btn {
    width: 100% !important;
  }
}
