/* Custom Font */
@font-face {
  font-family: 'Akt Thin';
  src: url('/css/fonts/font.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Style Font';
  src: url('/css/fonts/default-font.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Style Font', sans-serif !important;
}

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

body {
  font-family: 'Akt Thin', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #000;
  color: #fff;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  text-decoration: none;
}

.auth-logo {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: contain;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.auth-logo:hover {
  opacity: 1;
}

#wave {
  position: fixed;
  width: calc(100% + 30px);
  height: calc(100% + 30px);
  left: -15px;
  top: -15px;
  display: block;
  filter: blur(2px);
  opacity: 0.94;
  transform: translateZ(0);
  will-change: transform;
  z-index: 0;
}

.auth-layout {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: min(100%, 520px);
  padding: 40px 24px;
}

.auth-container {
  flex: 0 0 auto;
  width: 100%;
  max-width: 440px;
  margin: 0;
}

.auth-box {
  background: rgba(128, 128, 128, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 48px 40px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.form-container {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.form-container.hidden {
  display: none;
  opacity: 0;
  transform: translateY(10px);
}

.form-container h2 {
  font-size: 24px;
  font-family: 'Style Font', 'Akt Thin', sans-serif;
  font-weight: 600;
  margin-bottom: 28px;
  text-align: left;
}

.input-group {
  margin-bottom: 16px;
}

.password-group {
  position: relative;
}

.input-group input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.password-group input {
  padding-right: 48px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: color 0.2s ease;
}

.toggle-password:hover {
  color: #999;
}

.toggle-password svg {
  width: 20px;
  height: 20px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toggle-password .eye-off-icon {
  display: none;
}

.toggle-password.visible .eye-icon {
  display: none;
}

.toggle-password.visible .eye-off-icon {
  display: block;
}

.input-group input:focus {
  outline: none;
  border: 1px solid transparent;
  background: linear-gradient(#0f0f0f, #0f0f0f) padding-box,
              linear-gradient(135deg, #00CABA, #007370) border-box;
}

.input-group input::placeholder {
  color: #666;
}

.btn-primary {
  width: 100%;
  height: 48px;
  background: #2a2a2a;
  color: #666;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: not-allowed;
  margin-top: 8px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-primary.active {
  background: linear-gradient(135deg, #00CABA, #007370);
  color: #fff;
  cursor: pointer;
}

.btn-primary.active:hover {
  background: linear-gradient(135deg, #00E5D0, #008C87);
  transform: translateY(-1px);
}

.btn-primary.active:active {
  transform: translateY(0);
}

.toggle-text {
  text-align: center;
  margin-top: 24px;
  color: #999;
  font-size: 14px;
}

.link {
  color: #fff;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.link:hover {
  color: #ccc;
}

/* Footer */
.auth-footer {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
}

.footer-link {
  color: #999;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: #fff;
}

.footer-divider {
  color: #666;
}

/* Mobile */
@media (max-width: 1024px) {
  .auth-layout {
    flex-direction: column;
    gap: 20px;
    padding: 40px 20px;
    margin-inline: auto;
  }
  
  .auth-container {
    width: 100%;
    max-width: 420px;
  }
}

@media (max-width: 600px) {
  body {
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .auth-logo {
    width: 60px;
    height: 60px;
  }
  
  .auth-layout {
    flex: 1 0 auto;
    justify-content: center;
    gap: 18px;
    padding: max(28px, calc(env(safe-area-inset-top) + 16px)) 20px 28px;
  }

  .auth-container { max-width: 440px; }
  
  .auth-box {
    padding: 28px 22px;
    border-radius: 18px;
  }
  
  .form-container h2 {
    font-size: 22px;
    text-align: center;
  }
  
  .auth-footer {
    position: relative;
    left: auto;
    bottom: auto;
    transform: none;
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 12px 20px max(16px, env(safe-area-inset-bottom));
    font-size: 12px;
    text-align: center;
  }
  
  .footer-divider {
    display: inline;
  }

  .input-group input,
  .btn-primary {
    height: 50px;
  }

  .policy-modal {
    padding: 16px;
  }

  .policy-modal-content {
    width: 100%;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    padding: 24px 20px;
  }

  .policy-modal-buttons {
    gap: 10px;
  }

  .policy-btn {
    height: 44px;
  }
}

@media (max-width: 600px) and (max-height: 700px) {
  .auth-layout {
    gap: 18px;
    padding-top: max(70px, calc(env(safe-area-inset-top) + 60px));
    padding-bottom: 16px;
  }

  .auth-box {
    padding: 22px 20px;
  }

  .form-container h2 {
    margin-bottom: 18px;
  }

  .input-group {
    margin-bottom: 12px;
  }

  .toggle-text {
    margin-top: 18px;
  }
}

/* Policy Modal */
.policy-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.policy-modal.show {
  display: flex;
  opacity: 1;
}

.policy-modal-content {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 16px;
  padding: 32px;
  max-width: 480px;
  width: 90%;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.policy-modal-title {
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 16px;
}

.policy-modal-text {
  font-size: 14px;
  color: #999;
  margin-bottom: 24px;
  line-height: 1.5;
}

.policy-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}

.auth-inline-consent {
  width: min(100%, 420px);
  max-width: 100%;
  align-items: stretch;
  margin: 4px 0 18px;
  gap: 8px;
  margin-inline: auto;
}

.auth-inline-consent .policy-checkbox {
  width: 100%;
  max-width: 100%;
  align-items: center;
}

.auth-inline-consent input[type="checkbox"] {
  appearance: none;
  position: relative;
  width: 21px;
  height: 21px;
  margin: 0;
  flex: 0 0 21px;
  border: 1px solid #555b60;
  border-radius: 6px;
  background: rgba(10, 10, 10, .8);
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.auth-inline-consent input[type="checkbox"]::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 5px;
  height: 9px;
  border: solid #101010;
  border-width: 0 2px 2px 0;
  opacity: 0;
  transform: rotate(45deg) scale(.8);
  transition: opacity .12s ease, transform .12s ease;
}

.auth-inline-consent input[type="checkbox"]:checked {
  border-color: #fff;
  background: #fff;
}

.auth-inline-consent input[type="checkbox"]:checked::after {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}

.auth-inline-consent input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(255, 255, 255, .45);
  outline-offset: 3px;
}

.policy-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.policy-checkbox input[type="checkbox"] {
  margin-top: 2px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: #00CABA;
}

.policy-checkbox span {
  font-size: 14px;
  color: #fff;
  line-height: 1.5;
}

.policy-checkbox a {
  color: #00CABA;
  text-decoration: underline;
}

.policy-checkbox a:hover {
  color: #00E5D0;
}

.policy-modal-buttons {
  display: flex;
  gap: 12px;
}

.policy-btn {
  flex: 1;
  height: 44px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.policy-btn-cancel {
  background: transparent;
  border: 1px solid #2a2a2a;
  color: #999;
}

.policy-btn-cancel:hover {
  background: #1a1a1a;
  border-color: #3a3a3a;
  color: #fff;
}

.policy-btn-confirm {
  background: #2a2a2a;
  color: #666;
  cursor: not-allowed;
}

.policy-btn-confirm:not(:disabled) {
  background: linear-gradient(135deg, #00CABA, #007370);
  color: #fff;
  cursor: pointer;
}

.policy-btn-confirm:not(:disabled):hover {
  background: linear-gradient(135deg, #00E5D0, #008C87);
  transform: translateY(-1px);
}

.policy-btn-confirm:not(:disabled):active {
  transform: translateY(0);
}

/* Error state for buttons */
.btn-primary.error {
  background: #ff4444 !important;
  color: #fff !important;
  cursor: not-allowed !important;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.phone-verification-view {
  width: 100%;
  animation: phoneVerificationIn .24s ease both;
}

.phone-verification-view.hidden { display: none; }
.auth-box:has(.phone-verification-view:not(.hidden)) { padding: 32px; }
.phone-step-controls { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 18px auto 0; }
.phone-verification-step.hidden { display: none; }
.auth-phone-input { width: 100%; min-height: 54px; box-sizing: border-box; padding: 0 16px; border: 1px solid #303030; border-radius: 14px; background: #090909; color: #fff; font: inherit; font-size: 16px; }
.phone-step-next { margin-top: 18px; border-radius: 14px; background: #fff; color: #080808; }
.phone-step-back { display: block; margin: 4px auto 0; border: 0; background: none; color: #aaa; font: inherit; cursor: pointer; }
.phone-step-next[hidden] { display: none; }
.phone-step-dots { display: flex; justify-content: center; gap: 8px; margin: 0; }
.phone-step-next { margin: 12px auto 0; color: #111; }
.phone-step-back[hidden] { display: none; }
.phone-step-back { margin-top: 10px; }
.phone-step-dots span { width: 7px; height: 7px; border-radius: 50%; background: #555; transition: background .2s, transform .2s; }
.phone-step-dots span.active { background: #fff; transform: scale(1.2); }

.phone-verification-view h2 {
  margin: 0 0 28px;
  font-family: 'Style Font', 'Akt Thin', sans-serif;
  font-size: 24px;
  font-weight: 600;
  text-align: left;
}

@keyframes phoneVerificationIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.phone-verification-subtitle {
  margin: 0 0 16px;
  color: #929292;
  font-size: 14px;
  text-align: left;
}

.phone-telegram-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: min(100%, 360px);
  min-height: 48px;
  margin: 0;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 13px;
  background: #229ED9;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: none;
  transition: background .18s ease, transform .18s ease;
}

.phone-telegram-action:hover {
  background: #1b91ca;
  transform: translateY(-1px);
}

.phone-telegram-action:active { transform: translateY(0) scale(.99); }
.phone-telegram-action.is-unavailable { opacity: .45; pointer-events: none; }
.phone-telegram-icon { width: 22px; height: 22px; flex: 0 0 auto; }
.phone-verification-status {
  max-width: 360px;
  margin: 12px 0 0;
  color: #ff9292;
  font-size: 13px;
  line-height: 1.45;
}
.phone-continue-action svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.phone-continue-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: min(100%, 360px);
  min-height: 52px;
  margin-top: 12px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: #9b9b9b;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color .18s ease;
}

.phone-continue-action:hover { color: #fff; }
.phone-continue-action:disabled { opacity: .55; cursor: wait; }
.phone-continue-action svg { width: 18px; height: 18px; }

@media (max-width: 600px) {
  .auth-box:has(.phone-verification-view:not(.hidden)) { padding: 24px 22px; }
  .phone-step-controls { margin-top: 14px; }
  .phone-verification-view h2 { margin-bottom: 18px; font-size: 22px; text-align: left; }
  .phone-telegram-action { min-height: 46px; padding: 0 16px; font-size: 14px; }
  .phone-continue-action { min-height: 48px; }

  .auth-inline-consent {
    width: 100%;
    gap: 12px;
  }

  .auth-inline-consent .policy-checkbox {
    align-items: flex-start;
    gap: 10px;
  }

  .auth-inline-consent input[type="checkbox"] {
    margin-top: 2px;
  }

  .auth-inline-consent .policy-checkbox span {
    min-width: 0;
    font-size: 13px;
    line-height: 1.4;
  }
}

