* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
  font-family: "Lexend", sans-serif;
  background: linear-gradient(135deg, #BFEF1E, #10512A);
}

.back-arrow {
  position: absolute;
  top: 20px;
  left: 20px;
  text-decoration: none;
  font-size: 22px;
  color: #ffffff;
  font-weight: bold;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.back-arrow:hover {
  text-decoration: underline;
}

.arrow-icon {
  width: 20px;
  height: 20px;
}

.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100%;
  padding: 16px;
}

.text {
  margin: 0;
  max-width: 340px;
  width: 100%;
}

.login {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  padding: 40px;
  padding-bottom: 30px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.nadpis {
  margin-bottom: 24px;
  font-size: 42px;
  color: #10512A;
  font-weight: bold;
}

/* ========================================
   LOGIN STEPS
   ======================================== */

.login-step {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.login-step.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   FORMS
   ======================================== */

form {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 16px;
}

form input[type="email"],
form input[type="text"]:not(.otp-input) {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #ecf0f6;
  border-radius: 12px;
  background-color: #f8f9fa;
  color: #333;
  font-size: 16px;
  transition: all 0.3s ease;
  font-family: Lexend;
}

form input[type="email"]:focus,
form input[type="text"]:not(.otp-input):focus {
  outline: none;
  border-color: #BFEF1E;
  background-color: #f4fda632;
  box-shadow: 0 0 0 4px rgba(191, 239, 30, 0.15);
}

/* ========================================
   BUTTONS
   ======================================== */

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: linear-gradient(135deg, #BFEF1E, #a8d619);
  color: #10512A;
  cursor: pointer;
  border: none;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.3s ease;
  font-family: Lexend;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(191, 239, 30, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary svg {
  transition: transform 0.3s ease;
}

.btn-primary:hover svg {
  transform: translateX(4px);
}

/* ========================================
   OTP SECTION
   ======================================== */

.otp-info {
  margin-bottom: 24px;
  padding: 16px;
  background: linear-gradient(135deg, #f0fdf4, #e8f5e9);
  border-radius: 12px;
  border: 1px solid #c8e6c9;
}

.otp-message {
  font-size: 14px;
  color: #666;
  margin-bottom: 4px;
}

.otp-email {
  font-size: 16px;
  font-weight: 600;
  color: #10512A;
  word-break: break-all;
}

.otp-inputs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 8px;
}

.otp-input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  border: 2px solid #ecf0f6;
  border-radius: 12px;
  background-color: #f8f9fa;
  color: #10512A;
  transition: all 0.2s ease;
  font-family: Lexend;
}

.otp-input:focus {
  outline: none;
  border-color: #BFEF1E;
  background-color: #fff;
  box-shadow: 0 0 0 4px rgba(191, 239, 30, 0.2);
  transform: scale(1.05);
}

.otp-input.filled {
  border-color: #BFEF1E;
  background-color: #f4fda6;
}

.otp-input.error {
  border-color: #ef4444;
  background-color: #fef2f2;
  animation: shake 0.5s ease;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-5px);
  }

  40%,
  80% {
    transform: translateX(5px);
  }
}

/* ========================================
   OTP ACTIONS
   ======================================== */

.otp-actions {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: none;
  border: none;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  font-family: Lexend;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.link-btn:hover {
  color: #10512A;
  background-color: #f0f0f0;
}

.link-btn svg {
  transition: transform 0.2s ease;
}

.link-btn:hover svg {
  transform: scale(1.1);
}

#resend-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========================================
   ERROR MESSAGE
   ======================================== */

.error-message {
  display: none;
  margin-top: 16px;
  padding: 12px 16px;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #dc2626;
  font-size: 14px;
  text-align: center;
}

.error-message.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   SUCCESS STATE
   ======================================== */

.success-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px;
}

.success-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #BFEF1E, #a8d619);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: scaleIn 0.5s ease;
}

.success-icon svg {
  color: #10512A;
}

@keyframes scaleIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ========================================
   LOADING STATE
   ======================================== */

.btn-primary.loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn-primary.loading span {
  opacity: 0;
}

.btn-primary.loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: #10512A;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.footer-logo {
  display: block;
  margin: 0 auto;
  width: 65px;
  height: auto;
  margin-top: 30px;
}

.text:has(#step-otp.active) .footer-text {
  display: none;
}

@media (max-width: 768px) {
  .login {
    padding: 24px;
    margin: 16px;
  }

  .nadpis {
    font-size: 32px;
  }

  .otp-input {
    width: 42px;
    height: 50px;
    font-size: 20px;
  }

  .otp-inputs {
    gap: 6px;
  }

  form input[type="email"] {
    font-size: 14px;
  }

  .back-arrow {
    font-size: 16px;
    top: 12px;
    left: 12px;
  }
}

@media (max-width: 380px) {
  .otp-input {
    width: 36px;
    height: 44px;
    font-size: 18px;
    border-radius: 8px;
  }

  .otp-inputs {
    gap: 4px;
  }
}