/* ==========================================================================
   Auth CSS — Rabata.io
   Dark cinematic theme for login, registration, password reset pages
   Ported 1:1 from PHP login.scss + controls.scss
   ========================================================================== */

/* --- CSS Custom Properties (same as dashboard.css) --- */
:root {
  /* Backgrounds */
  --color-bg-deep: #06080D;
  --color-bg-surface: #0C1019;
  --color-bg-card: #111622;
  --color-bg-card-hover: #161D2E;

  /* Legacy aliases */
  --color-white: #FFFFF5;

  /* Primary */
  --color-main: #2556BB;
  --color-second: #8FE7F1;
  --color-second-dark: #6DD5E0;

  /* Text */
  --color-text: #E8ECF4;
  --color-text-secondary: #8A94A8;
  --color-text-muted: #5A6478;

  /* Special */
  --color-placeholder: rgba(232, 236, 244, 0.4);

  /* Status */
  --color-error: #FF5858;

  /* Borders */
  --color-border: rgba(143, 231, 241, 0.08);
  --color-border-strong: rgba(143, 231, 241, 0.15);

  /* Shadows */
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(143, 231, 241, 0.15);

  /* Fonts */
  --font-inter: "Inter", sans-serif;
  --font-tektur: "Tektur", sans-serif;

  /* Typography */
  --text-small: 12px;
  --text-less: 14px;
  --text-normal: 16px;
  --text-larger: 18px;
  --text-h3: 20px;
  --text-pre-middle: 22px;
  --text-h2: 28px;

  /* Border Radius */
  --radius: 12px;
  --radius-sm: 8px;
}

/* --- Fonts --- */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Tektur:wght@400;600;700&display=swap");

/* --- Reset / Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: var(--font-inter);
  font-weight: normal;
  font-style: normal;
  min-width: 320px;
  min-height: 100%;
  background-color: var(--color-bg-deep);
  color: var(--color-text);
  font-size: var(--text-normal);
  line-height: 1.2;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

/* --- Text utilities --- */
.text-colored {
  color: var(--color-second);
}

.text-link {
  text-decoration: underline;
}

.text-link:hover {
  color: var(--color-second);
}

/* --- Input --- */
.input {
  display: block;
  width: 100%;
  font-family: var(--font-inter);
  font-size: var(--text-normal);
  line-height: var(--text-normal);
  background: var(--color-bg-card);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  padding: 15px 18px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  outline: none;
}

.input::placeholder {
  color: var(--color-placeholder);
}

.input:focus {
  border-color: var(--color-second);
  box-shadow: 0 0 0 2px rgba(143, 231, 241, 0.1);
}

.input.is-error {
  border-color: var(--color-error);
}

.input-group {
  position: relative;
  width: 100%;
}

.input-error {
  display: none;
  position: absolute;
  height: max-content;
  top: calc(100% + 11px);
  background-color: var(--color-bg-card);
  font-size: var(--text-small);
  box-shadow: var(--shadow);
  padding: 7px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  z-index: 10;
  color: var(--color-error);
}

/* --- Checkbox --- */
.checkbox-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  accent-color: var(--color-second);
  cursor: pointer;
  margin-top: 2px;
}

.checkbox__text {
  font-size: var(--text-less);
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.checkbox__link {
  color: var(--color-second);
  text-decoration: underline;
}

/* --- Button --- */
.button {
  display: block;
  width: 100%;
  font-family: var(--font-inter);
  font-size: var(--text-normal);
  line-height: var(--text-normal);
  font-weight: 600;
  color: var(--color-bg-deep);
  text-align: center;
  padding: 15px 24px;
  border: solid 1px transparent;
  background: linear-gradient(135deg, var(--color-second), var(--color-second-dark));
  box-shadow: var(--shadow-glow);
  border-radius: var(--radius-sm);
  transition: all ease 0.3s;
  cursor: pointer;
}

.button:hover {
  box-shadow: 0 0 30px rgba(143, 231, 241, 0.3);
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
  box-shadow: var(--shadow-glow);
}

.button--white {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border-strong);
  box-shadow: none;
}

.button--white:hover {
  border-color: var(--color-second);
  background: rgba(143, 231, 241, 0.05);
  box-shadow: none;
}

/* Button icons */
.button__text-google,
.button__text-github {
  position: relative;
  padding-left: 32px;
}

.button__text-google::before,
.button__text-github::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background-repeat: no-repeat;
  background-size: cover;
}

.button__text-google::before {
  background-image: url("/images/icon_google.svg");
}

.button__text-github::before {
  background-image: url("/images/icon_github.svg");
}

/* --- Error / Flash --- */
.error {
  color: var(--color-error);
  font-weight: 700;
  font-size: var(--text-less);
}

.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: var(--text-less);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.flash--notice {
  background: rgba(143, 231, 241, 0.08);
  border: 1px solid rgba(143, 231, 241, 0.15);
  color: var(--color-second);
}

.flash--alert {
  background: rgba(255, 88, 88, 0.08);
  border: 1px solid rgba(255, 88, 88, 0.15);
  color: var(--color-error);
}

.flash--floating {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  min-width: 300px;
  text-align: center;
}

/* ==========================================================================
   Authorization Layout
   ========================================================================== */
.authorization {
  overflow: hidden;
  height: 100vh;
}

.authorization h1 {
  font-family: var(--font-tektur);
  font-size: var(--text-h2);
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--color-text);
}

.authorization__wrapper {
  height: 100%;
  padding: 40px;
}

.authorization__inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.authorization__form {
  position: relative;
  z-index: 5;
}

.authorization__link-back {
  font-family: var(--font-tektur);
  font-weight: 600;
  font-size: var(--text-larger);
  color: var(--color-second);
  padding-left: 30px;
  position: absolute;
  top: 0;
  left: 0;
  cursor: pointer;
  text-decoration: none;
}

.authorization__link-back::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  background-image: url("/images/icon_back-arrow.svg");
  left: 0;
  top: calc(50% - 12px);
}

.authorization__text {
  margin-bottom: 20px;
  color: var(--color-text-secondary);
}

.authorization__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.authorization__row--wrapper {
  display: block;
  gap: 0;
}

.authorization__row form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.authorization__col {
  width: 100%;
}

.authorization__col--align-right {
  text-align: right;
}

.authorization__col--50 {
  flex: 1;
}

.authorization__checkbox {
  width: 100%;
  margin-top: 10px;
  color: var(--color-text-secondary);
}

.authorization__button {
  width: 100%;
}

.authorization__buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
  position: relative;
}

.authorization__buttons .button {
  margin-bottom: 0;
}

.authorization__link {
  margin-top: 10px;
  color: var(--color-second);
  text-decoration: underline;
  cursor: pointer;
}

.authorization__separate {
  display: flex;
  align-items: center;
  margin: 10px 0;
}

.authorization__separate-line {
  flex: 1;
  height: 1px;
  background-color: var(--color-border-strong);
}

.authorization__separate-text {
  padding: 0 10px;
  color: var(--color-text-muted);
}

.authorization__oauth-buttons {
  display: flex;
  gap: 10px;
  width: 100%;
}

.authorization__oauth-buttons .button {
  flex: 1;
  background: transparent;
  border: 1px solid var(--color-border-strong);
  color: var(--color-text);
  box-shadow: none;
}

.authorization__oauth-buttons .button:hover {
  border-color: var(--color-second);
  background: rgba(143, 231, 241, 0.05);
  box-shadow: none;
}

/* ==========================================================================
   Geometric Background (CSS-only simplified version for auth pages)
   ========================================================================== */
.geo-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.geo-glow {
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

.geo-glow--top-left {
  top: -120px;
  left: -80px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(143, 231, 241, 0.06) 0%, transparent 70%);
  filter: blur(60px);
}

.geo-glow--bottom-right {
  bottom: -150px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(37, 86, 187, 0.08) 0%, transparent 70%);
  filter: blur(80px);
}

.geo-glow--center {
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(143, 231, 241, 0.03) 0%, transparent 60%);
  filter: blur(120px);
}

.geo-shape {
  position: absolute;
  border: 1px solid rgba(143, 231, 241, 0.04);
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.geo-shape--diamond {
  width: 40px;
  height: 40px;
  transform: rotate(45deg);
  background: rgba(143, 231, 241, 0.03);
  border-color: rgba(143, 231, 241, 0.06);
}

.geo-shape--diamond:nth-child(1) {
  top: 15%;
  right: 20%;
  animation: geo-drift-down 20s infinite;
}

.geo-shape--diamond:nth-child(2) {
  width: 24px;
  height: 24px;
  top: 60%;
  left: 8%;
  animation: geo-drift-up 18s infinite;
}

.geo-shape--diamond:nth-child(3) {
  width: 32px;
  height: 32px;
  bottom: 35%;
  right: 15%;
  animation: geo-drift-down 22s infinite;
  animation-delay: -5s;
}

.geo-shape--hexagon {
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: linear-gradient(135deg, rgba(143, 231, 241, 0.02), transparent);
  border: 0;
}

.geo-shape--hexagon:nth-child(4) {
  width: 120px;
  height: 120px;
  top: 8%;
  left: 5%;
  animation: geo-float-1 25s infinite;
}

.geo-shape--hexagon:nth-child(5) {
  width: 80px;
  height: 80px;
  top: 35%;
  right: 8%;
  animation: geo-float-2 30s infinite;
}

.geo-shape--circle {
  border-radius: 50%;
  background: transparent;
}

.geo-shape--circle:nth-child(6) {
  width: 200px;
  height: 200px;
  top: 45%;
  left: 25%;
  border-color: rgba(143, 231, 241, 0.03);
  animation: geo-pulse 12s ease-in-out infinite;
}

/* --- Keyframes --- */
@keyframes geo-float-1 {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(15px, -20px); }
  50% { transform: translate(-10px, -35px); }
  75% { transform: translate(20px, -15px); }
}

@keyframes geo-float-2 {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-20px, 15px); }
  50% { transform: translate(10px, 30px); }
  75% { transform: translate(-15px, 10px); }
}

@keyframes geo-drift-down {
  0%, 100% { transform: rotate(45deg) translateY(0); opacity: 0.4; }
  50% { transform: rotate(45deg) translateY(30px); opacity: 1; }
}

@keyframes geo-drift-up {
  0%, 100% { transform: rotate(45deg) translateY(0); opacity: 0.6; }
  50% { transform: rotate(45deg) translateY(-25px); opacity: 1; }
}

@keyframes geo-pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.15); opacity: 1; }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  .geo-shape {
    animation: none !important;
  }

  .geo-glow {
    display: none;
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Desktop / small-desktop */
@media screen and (max-width: 1199px) {
  .authorization h1 {
    font-size: var(--text-pre-middle);
  }

  .authorization__link-back {
    font-size: var(--text-less);
  }

  .authorization__row {
    gap: 20px;
  }

  .authorization__row form {
    gap: 20px;
  }

  .authorization__col--50 {
    flex: auto;
    width: calc(50% - 10px);
  }

  .authorization__checkbox {
    width: 100%;
    margin-top: 0;
    margin-bottom: 10px;
  }

  .authorization__buttons {
    margin-top: 0;
  }
}

/* Tablet */
@media screen and (max-width: 768px) {
  .authorization__wrapper {
    padding: 20px;
  }

  .authorization h1 {
    margin-bottom: 10px;
  }

  .authorization__row {
    gap: 12px;
  }

  .authorization__row form {
    gap: 12px;
  }

  .authorization__col {
    flex: auto;
  }

  .authorization__col--align-right {
    margin-top: -2px;
  }

  .authorization__col--50 {
    width: 100%;
  }

  .authorization__buttons {
    flex-direction: column;
    margin-top: 12px;
    gap: 12px;
  }

  .authorization__button {
    margin-right: 0;
  }

  .authorization__checkbox {
    margin-bottom: 0;
  }

  .authorization__separate {
    margin: 12px 0;
  }

  .authorization__oauth-buttons {
    flex-direction: column;
  }
}

/* Short viewport */
@media screen and (max-height: 750px) {
  .authorization {
    height: auto;
    min-height: 100vh;
  }

  .authorization__inner {
    min-height: 100vh;
    padding-top: 100px;
    padding-bottom: 50px;
  }
}
