/**
 * Login Form Styles
 * Dedicated CSS for login form with consistent design system
 * Design tokens: 4px base spacing, 44px input height, 12px border radius
 */

/* Form container */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  margin-top: 24px;
}

/* Field structure */
.login-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.login-form__label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.01em;
}

/* Input base styles */
.login-form__input {
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(8, 13, 26, 0.65);
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.login-form__input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.login-form__input:focus {
  outline: none;
  border-color: rgba(var(--tint-color), 0.6);
  background: rgba(12, 18, 32, 0.75);
  box-shadow: 0 0 0 3px rgba(var(--tint-color), 0.12);
}

.login-form__input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Error messages */
.login-form__error {
  min-height: 0;
  max-height: 0;
  overflow: hidden;
  color: #ff6b6b;
  font-size: 12px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.2s ease;
}

.login-form__error.v1-1-error-active {
  min-height: auto;
  max-height: 60px;
  opacity: 1;
  margin-top: 4px;
  transform: translateY(0);
}

.login-form__input.v1-1-input-error {
  border-color: #ff6b6b;
  background: rgba(255, 107, 107, 0.08);
}

.login-form__input.v1-1-input-error:focus {
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}

/* Success state */
.login-form__input.v1-1-input-success {
  border-color: rgba(74, 222, 128, 0.6);
  background: rgba(74, 222, 128, 0.05);
}

.login-form__input.v1-1-input-success:focus {
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.12);
}

/* Forgot password link */
.login-form__forgot {
  align-self: flex-end;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  margin-top: 4px;
  transition: color 0.2s ease;
}

.login-form__forgot:hover {
  color: #fff;
  text-decoration: underline;
}

/* Remember checkbox */
.login-form__checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 4px;
}

.login-form__checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(8, 13, 26, 0.6);
  appearance: none;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  flex-shrink: 0;
}

.login-form__checkbox input[type="checkbox"]:checked {
  background: rgba(var(--tint-color), 0.7);
  border-color: rgba(var(--tint-color), 0.9);
}

.login-form__checkbox input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: #fff;
  border-radius: 3px;
}

.login-form__checkbox input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--tint-color), 0.15);
}

/* Action buttons */
.login-form__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.login-form__actions .btn {
  width: 100%;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.login-form__actions .btn-primary {
  background: linear-gradient(135deg, var(--action-1), var(--action-2));
  border: none;
  color: var(--action-text);
  box-shadow: 0 12px 28px var(--action-shadow);
}

.login-form__actions .btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px var(--action-shadow);
  filter: brightness(1.03);
}

.login-form__actions .btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Register link */
.login-form__register {
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 4px;
}

.login-form__register a {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.login-form__register a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Auth card layout */
.auth-card--login {
  max-width: 460px;
  margin: 0 auto;
}

.auth-card--login .glass-content {
  padding: 32px;
}

@media (max-width: 599px) {
  .auth-card--login .glass-content {
    padding: 24px;
  }
}

/* Brand section */
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.auth-brand .brand-emblem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-brand .brand-emblem img,
.auth-brand .brand-emblem svg {
  max-width: 44px;
  max-height: 44px;
  object-fit: contain;
}

.auth-brand .brand-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.auth-brand .brand-name span {
  display: block;
  font-weight: 600;
  color: #fff;
  font-size: 16px;
  line-height: 1.2;
}

.auth-brand .brand-name small {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* Title section */
.auth-title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
}

.auth-sub {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.65);
  max-width: 380px;
}

/* Layout adjustments */
.auth-main--login {
  padding: 64px 0 48px;
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
}

@media (max-width: 768px) {
  .auth-main--login {
    padding: 48px 0 40px;
  }
}

/* Loading state */
.login-form.is-loading {
  pointer-events: none;
  opacity: 0.7;
}

.login-form.is-loading .btn-primary::after {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
