:root {
  --photo-auth-green: #89e53d;
  --photo-auth-green-bright: #c7ff4f;
  --photo-auth-panel: #111211;
}

.photo-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2rem);
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.photo-auth-overlay.is-open {
  display: flex;
}

.photo-auth-modal {
  position: relative;
  width: min(440px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background:
    radial-gradient(circle at 50% 0%, rgba(137, 229, 61, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 34%),
    var(--photo-auth-panel);
  box-shadow: 0 34px 120px rgba(0, 0, 0, 0.74), inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.photo-auth-modal.is-register {
  width: min(620px, 100%);
}

.photo-auth-modal::-webkit-scrollbar { width: 8px; }
.photo-auth-modal::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.photo-auth-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.55rem 0;
}

.photo-auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  text-decoration: none;
}

.photo-auth-brand-logo {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--photo-auth-green-bright), #65e247);
  color: #050605;
  font-weight: 900;
  letter-spacing: -0.08em;
  box-shadow: 0 0 26px rgba(137, 229, 61, 0.22);
}

.photo-auth-brand-text {
  display: grid;
  gap: 0.1rem;
  text-align: left;
}

.photo-auth-brand-text strong {
  font-size: 15px;
  line-height: 1;
}

.photo-auth-brand-text span {
  color: rgba(255, 255, 255, 0.42);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.photo-auth-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.72);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.photo-auth-close:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
}

.photo-auth-head {
  padding: 1rem 1.55rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  text-align: left;
}

.photo-auth-title {
  margin: 0;
  color: #fff;
  font-size: 27px;
  line-height: 1.1;
  font-weight: 780;
  letter-spacing: -0.03em;
}

.photo-auth-subtitle {
  margin: 0.55rem 0 0;
  color: rgba(255, 255, 255, 0.48);
  font-size: 13px;
}

.photo-auth-body {
  padding: 1.35rem 1.55rem 1.55rem;
}

.photo-auth-panel {
  display: block;
}

.photo-auth-panel[hidden] {
  display: none !important;
}

.photo-auth-flash {
  margin-bottom: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(248, 113, 113, 0.34);
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
  padding: 0.75rem 0.85rem;
  font-size: 13px;
  line-height: 1.5;
}

.photo-auth-flash[hidden] {
  display: none !important;
}

.photo-auth-flash.is-success {
  border-color: rgba(137, 229, 61, 0.32);
  background: rgba(137, 229, 61, 0.09);
  color: #b7f56e;
}

.photo-auth-form-stack {
  display: grid;
  gap: 0.9rem;
}

.photo-auth-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.photo-auth-field-wide,
.photo-auth-submit {
  grid-column: 1 / -1;
}

.photo-auth-field label {
  display: block;
  margin-bottom: 0.38rem;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.photo-auth-required {
  color: var(--photo-auth-green);
}

.photo-auth-input {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.36);
  color: #fff;
  padding: 0 0.85rem;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.photo-auth-modal.is-register .photo-auth-input {
  height: 42px;
}

.photo-auth-input::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

.photo-auth-input:focus {
  border-color: rgba(137, 229, 61, 0.55);
  background: rgba(0, 0, 0, 0.48);
  box-shadow: 0 0 0 3px rgba(137, 229, 61, 0.08);
}

.photo-auth-field-hint {
  margin-top: 0.35rem;
  color: rgba(255, 255, 255, 0.34);
  font-size: 11px;
  line-height: 1.45;
}

.photo-auth-account-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.photo-auth-account-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.photo-auth-account-toggle label {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.82rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.028);
  color: rgba(255, 255, 255, 0.68);
  cursor: pointer;
  margin-bottom: 0;
}

.photo-auth-radio-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow: inset 0 0 0 3px #151615;
}

.photo-auth-account-toggle input:checked + .photo-auth-radio-dot {
  border-color: var(--photo-auth-green);
  background: var(--photo-auth-green);
}

.photo-auth-account-toggle label:has(input:checked) {
  border-color: rgba(137, 229, 61, 0.46);
  background: rgba(137, 229, 61, 0.08);
  color: #fff;
}

.photo-auth-phone-row {
  display: flex;
  gap: 0.65rem;
}

.photo-auth-phone-row .photo-auth-input {
  flex: 1 1 auto;
  min-width: 0;
}

.photo-auth-btn-secondary {
  flex: 0 0 auto;
  height: 42px;
  padding: 0 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.photo-auth-btn-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.photo-auth-submit {
  width: 100%;
  height: 45px;
  margin-top: 0.25rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #d9ff2f 0%, var(--photo-auth-green) 56%, #5ee148 100%);
  color: #081006;
  font-size: 15px;
  font-weight: 820;
  letter-spacing: 0.06em;
  box-shadow: 0 12px 32px rgba(137, 229, 61, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.photo-auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.photo-auth-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin-top: 1rem;
  color: rgba(255, 255, 255, 0.42);
  font-size: 13px;
}

.photo-auth-links button,
.photo-auth-links a {
  border: 0;
  background: none;
  padding: 0;
  color: rgba(255, 255, 255, 0.68);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}

.photo-auth-links .photo-auth-accent {
  color: rgba(137, 229, 61, 0.9);
}

@media (max-width: 560px) {
  .photo-auth-overlay {
    align-items: flex-start;
    padding: 0.85rem;
  }

  .photo-auth-modal {
    max-height: none;
    border-radius: 14px;
  }

  .photo-auth-top,
  .photo-auth-head,
  .photo-auth-body {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  .photo-auth-form-grid {
    grid-template-columns: 1fr;
  }

  .photo-auth-field-wide,
  .photo-auth-submit {
    grid-column: auto;
  }

  .photo-auth-account-toggle {
    grid-template-columns: 1fr;
  }

  .photo-auth-phone-row {
    flex-direction: column;
  }

  .photo-auth-btn-secondary {
    width: 100%;
  }

  .photo-auth-links {
    flex-direction: column;
    gap: 0.4rem;
  }

  .photo-auth-links .photo-auth-sep {
    display: none;
  }
}
