* {
  box-sizing: border-box;
}

body.auth-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family:
    "Inter",
    "Segoe UI",
    -apple-system,
    BlinkMacSystemFont,
    "Helvetica Neue",
    sans-serif;
  color: var(--text-primary);
  background:
    radial-gradient(circle at top left, rgba(91, 103, 232, 0.16), transparent 34%),
    radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.14), transparent 30%),
    #eaf0fb;
  overflow-x: hidden;
}

body.auth-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.68), rgba(30, 41, 59, 0.42)),
    url("../design/main.back.jpg") center / cover no-repeat;
  z-index: -2;
}

body.auth-page::after {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.06), rgba(248, 250, 252, 0.18));
  z-index: -1;
}

.auth-shell {
  width: min(1180px, calc(100% - 48px));
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 48px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 440px);
  gap: 28px;
  align-items: center;
}

.auth-brand-panel,
.auth-panel {
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(18px);
}

.auth-brand-panel {
  padding: 44px 42px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.52));
  color: #f8fafc;
  box-shadow: var(--shadow-xl);
}

.auth-brand-badge,
.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-brand-badge {
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  margin-bottom: 26px;
}

.institution-name {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(2.3rem, 4vw, 3.8rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.system-title {
  margin: 22px 0 0;
  max-width: 58ch;
  font-size: 16px;
  line-height: 1.7;
  color: rgba(226, 232, 240, 0.88);
}

.brand-highlights {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.brand-highlight-card {
  padding: 18px 18px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-highlight-card h2 {
  margin: 0 0 8px;
  font-size: 15px;
  color: #f8fafc;
}

.brand-highlight-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(226, 232, 240, 0.82);
}

.auth-panel {
  padding: 36px 34px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-xl);
}

.auth-panel-view--about {
  display: none;
}

.auth-panel-header h2,
.auth-modal-header h2 {
  margin: 10px 0 10px;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.auth-panel-header p,
.auth-modal-header p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

.auth-eyebrow {
  background: rgba(91, 103, 232, 0.1);
  color: var(--primary-color);
}

.auth-feedback {
  margin-top: 20px;
}

.auth-feedback--compact {
  margin-top: 18px;
  margin-bottom: 8px;
}

.login-form {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-group label {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.form-group input {
  width: 100%;
  min-height: 52px;
  border: 1px solid #d1dae8;
  border-radius: 16px;
  padding: 0 16px;
  background: #fbfcff;
  color: #0f172a;
  font-size: 14px;
  font-weight: 500;
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast), background var(--motion-fast);
}

.form-group input::placeholder {
  color: #94a3b8;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: var(--focus-ring);
  background: #ffffff;
}

.login-button {
  width: 100%;
  min-height: 54px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #4757d7 0%, #6d4cd7 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(71, 87, 215, 0.28);
  transition: transform var(--motion-fast), box-shadow var(--motion-fast), opacity var(--motion-fast);
}

.login-button span {
  display: block;
  width: 100%;
  text-align: center;
}

.login-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(71, 87, 215, 0.3);
}

.login-button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.auth-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.auth-actions--about {
  margin-top: 24px;
  justify-content: flex-end;
}

.auth-toggle-link {
  display: none;
  border: none;
  padding: 0;
  background: transparent;
  color: var(--primary-color);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
}

.auth-toggle-link:hover {
  text-decoration: underline;
}

.auth-toggle-link--primary {
  color: #ffffff;
}

.forgot-password-link {
  color: var(--primary-color);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.forgot-password-link:hover {
  text-decoration: underline;
}

.auth-modal {
  display: none;
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(8px);
  z-index: 250;
}

.auth-modal.show {
  display: flex;
}

.auth-modal-card {
  position: relative;
  width: min(100%, 460px);
  max-height: min(720px, calc(100dvh - 40px));
  overflow-y: auto;
  padding: 28px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(203, 213, 225, 0.7);
  box-shadow: var(--shadow-xl);
}

.auth-modal-card--forgot .auth-modal-header {
  margin-bottom: 20px;
}

.auth-modal-card--forgot .auth-feedback--compact {
  margin-bottom: 12px;
}

.auth-modal-card--forgot .form-group {
  margin-bottom: 14px;
}

.auth-modal-card--forgot .login-button {
  margin-top: 10px;
}

.auth-modal-header {
  margin-bottom: 18px;
  padding-right: 36px;
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 12px;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
}

.close-modal:hover {
  background: #e2e8f0;
}

.otp-inline-message[hidden],
.auth-feedback[hidden] {
  display: none !important;
}

.otp-inline-message {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.otp-inline-message.is-success {
  color: #166534;
}

.otp-inline-message.is-error {
  color: #b91c1c;
}

.error-message,
.auth-feedback .ui-message {
  margin: 0;
}

@media (max-width: 1180px) {
  .auth-shell {
    width: min(100%, calc(100% - 36px));
    grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
    gap: 22px;
    padding: 32px 0;
  }

  .auth-brand-panel {
    padding: 38px 32px;
  }

  .institution-name {
    max-width: 13ch;
  }
}

@media (max-width: 980px) {
  .auth-shell {
    width: min(100%, calc(100% - 32px));
    grid-template-columns: 1fr;
    gap: 20px;
    min-height: auto;
    padding: 24px 0 32px;
  }

  .auth-panel {
    order: -1;
  }

  .auth-brand-panel {
    padding: 32px 26px;
  }

  .institution-name {
    max-width: none;
  }

  .brand-highlights {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    padding: 28px 22px;
  }
}

@media (max-width: 640px) {
  body.auth-page {
    min-height: 100dvh;
  }

  .auth-brand-panel,
  body.auth-page.auth-mobile-about-active .auth-brand-panel {
    display: none;
  }

  .auth-shell {
    width: min(100%, calc(100% - 16px));
    min-height: 100dvh;
    padding: 16px 0;
    gap: 16px;
    align-content: center;
  }

  .auth-brand-panel,
  .auth-panel,
  .auth-modal-card {
    border-radius: 22px;
  }

  .auth-panel-view--about {
    padding: 2px 0;
    background: linear-gradient(180deg, rgba(28, 42, 77, 0.92), rgba(67, 79, 107, 0.94));
    color: #f8fafc;
  }

  body.auth-page.auth-mobile-about-active .auth-panel {
    background: linear-gradient(180deg, rgba(36, 49, 82, 0.96), rgba(72, 83, 111, 0.94));
    border-color: rgba(255, 255, 255, 0.18);
  }

  body.auth-page.auth-mobile-about-active .auth-panel-view--login {
    display: none;
  }

  body.auth-page.auth-mobile-about-active .auth-panel-view--about {
    display: block;
  }

  body.auth-page.auth-mobile-about-active .auth-panel-view--about .brand-highlight-card {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.12);
  }

  body.auth-page.auth-mobile-about-active .auth-panel-view--about .brand-highlight-card p,
  body.auth-page.auth-mobile-about-active .auth-panel-view--about .system-title {
    color: rgba(226, 232, 240, 0.88);
  }

  .auth-brand-panel {
    padding: 24px 20px;
  }

  .auth-panel,
  .auth-modal-card {
    padding: 22px 18px;
  }

  .auth-brand-badge,
  .auth-eyebrow {
    min-height: 30px;
    padding: 0 12px;
    font-size: 11px;
  }

  .auth-panel-header h2,
  .auth-modal-header h2 {
    font-size: 26px;
  }

  .institution-name {
    font-size: 2rem;
  }

  .system-title {
    margin-top: 18px;
    font-size: 14px;
  }

  .login-form {
    gap: 16px;
  }

  .form-group input {
    min-height: 50px;
    font-size: 16px;
  }

  .login-button {
    min-height: 52px;
  }

  .auth-actions {
    justify-content: space-between;
    gap: 12px;
  }

  .auth-toggle-link {
    display: inline-flex;
    align-items: center;
  }

  .auth-actions--about .auth-toggle-link {
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
  }

  .auth-modal {
    padding: 12px;
  }

  .auth-modal-card {
    width: 100%;
    max-height: calc(100dvh - 24px);
  }

  .auth-modal-card--forgot {
    padding: 20px 18px 18px;
  }

  .auth-modal-card--forgot .auth-modal-header {
    padding-right: 52px;
    margin-bottom: 16px;
  }

  .auth-modal-card--forgot .close-modal {
    top: 16px;
    right: 16px;
  }

  .auth-modal-card--forgot .form-group {
    gap: 8px;
  }

  .auth-modal-card--forgot .form-group label {
    font-size: 12px;
  }

  .auth-modal-card--forgot .login-button {
    margin-top: 10px;
  }
}

@media (max-width: 420px) {
  .auth-brand-panel {
    padding: 20px 16px;
  }

  .auth-panel,
  .auth-modal-card {
    padding: 20px 16px;
  }

  .auth-actions {
    gap: 10px;
  }

  .institution-name {
    font-size: 1.75rem;
  }

  .auth-panel-header h2,
  .auth-modal-header h2 {
    font-size: 24px;
  }
}
