@import url('https://fonts.googleapis.com/css2?family=Scada:wght@400;700&display=swap');

:root {
  --primary: #327095;
  --primary-dark: #285c77;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --glass-bg: rgba(255, 255, 255, 0.75);
  --border-soft: rgba(0, 0, 0, 0.08);
  --warning: #9a6700;
  --warning-bg: rgba(250, 204, 21, 0.16);
  --error: #991b1b;
  --error-bg: #fee2e2;
  --success: #065f46;
  --success-bg: #d1fae5;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Scada', sans-serif;
}

html,
body {
  height: 100%;
}

body {
  background: #d9e4ec;
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  background: url("../images/bg.jpg") center / cover no-repeat fixed;
}

.auth-panel {
  width: 420px;
  padding: 48px 40px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  box-shadow: 8px 0 30px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
}

.logo {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  margin-bottom: 40px;
  color: var(--primary);
}

.logo-word {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1;
}

.logo-word span {
  color: var(--text-main);
}

.logo small {
  margin-top: -2px;
  margin-left: 67px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 2px;
  color: var(--text-muted);
  display: inline-block;
  width: 51px;
  text-align: justify;
  text-align-last: justify;
}

.auth-panel h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 30px;
}

.auth-tabs {
  display: flex;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 28px;
}

.auth-tab {
  flex: 1;
  padding: 10px 0;
  font-size: 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
  color: var(--text-muted);
  transition: all 0.25s ease;
}

.auth-tab.is-active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.auth-form {
  display: none;
  flex-direction: column;
}

.auth-form.is-active {
  display: flex;
}

.auth-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 0;
  font-size: 14px;
  color: var(--text-main);
}

.auth-label span {
  display: none;
}

.auth-label input,
.forgot-panel input {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 14px;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  font-size: 14px;
  background: rgba(255, 255, 255, 0.96);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.auth-label input:focus,
.forgot-panel input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(50, 112, 149, 0.15);
}

.auth-btn {
  margin-top: 10px;
  padding: 14px;
  border-radius: 14px;
  border: none;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  background: #e5e7eb;
  color: var(--text-main);
  transition: all 0.25s ease;
}

.auth-btn:hover {
  background: #d1d5db;
}

.auth-btn-primary {
  background: var(--primary);
  color: #fff;
}

.auth-btn-primary:hover {
  background: var(--primary-dark);
}

.auth-message {
  margin-top: 10px;
  font-size: 14px;
  padding: 12px;
  border-radius: 12px;
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  text-align: center;
}

.auth-message.is-visible {
  display: block;
  opacity: 1;
}

.auth-message-success {
  background-color: var(--success-bg);
  color: var(--success);
}

.auth-message-error {
  background-color: var(--error-bg);
  color: var(--error);
}

.auth-message-warning {
  background-color: var(--warning-bg);
  color: var(--warning);
}

.forgot-wrap {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.forgot-link-btn {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  padding: 2px 0;
}

.forgot-link-btn:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.forgot-panel {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.forgot-panel input {
  margin-bottom: 0;
}

.forgot-code-row,
.forgot-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.forgot-mini-btn {
  margin-top: 0;
  height: 46px;
  min-height: 46px;
  padding: 0 12px;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

#forgotPwdMessage {
  margin-top: 0;
}

@media (max-width: 720px) {
  .auth-page {
    justify-content: center;
    padding: 0;
  }

  .auth-panel {
    width: 100%;
    min-height: 100vh;
    padding: 32px 24px;
  }
}
