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

:root {
  --color-student-primary: #732cdd;
  --color-student-secondary: #5e42bd;
  --shadow-glow-student: rgba(115, 44, 221, 0.3);
  
  --color-background: linear-gradient(135deg, var(--color-student-primary) 0%, var(--color-student-secondary) 100%);
  --color-surface: var(--color-background-white, #ffffff);
  
  --color-text-dark-primary: #121212;
  --color-text-dark-tertiary: rgba(18, 18, 18, 0.5);
  --color-text-on-primary: #ffffff;

  --color-success: #10b981;
  --color-success-glow: rgba(16, 185, 129, 0.4);
  --color-error: #ef4444;
  --color-error-bg: rgba(239, 68, 68, 0.1);
  --color-error-border: rgba(239, 68, 68, 0.3);
  
  --color-border-light: #e0e0e0;
  --color-input-focus-shadow: rgba(115, 44, 221, 0.15);

  --font-family-base: 'Rajdhani', sans-serif;
  --border-radius: 15px;
  --border-radius-small: 10px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-base);
  background: var(--color-background);
  color: var(--color-text-dark-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.container {
  background: var(--color-surface);
  border-radius: var(--border-radius);
  padding: 40px;
  width: 100%;
  max-width: 450px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(18, 18, 18, 0.3);
  position: relative;
}

.icon-container {
  margin-bottom: 24px;
}

.lock-icon {
  width: 64px;
  height: 64px;
  color: var(--color-student-primary);
  filter: drop-shadow(0 0 20px var(--shadow-glow-student));
  animation: pulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

h1 {
  color: var(--color-text-dark-primary);
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.subtitle {
  color: var(--color-student-primary);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 32px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-group {
  margin-bottom: 24px;
  text-align: left;
}

label {
  display: block;
  color: var(--color-text-dark-primary);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.password-container {
  position: relative;
}

input[type="password"], input[type="text"] {
  width: 100%;
  background: var(--color-surface);
  border: 2px solid var(--color-border-light);
  border-radius: var(--border-radius-small);
  padding: 15px 50px 15px 15px;
  color: var(--color-text-dark-primary);
  font-size: 1rem;
  font-family: var(--font-family-base);
  font-weight: 500;
  transition: all 0.3s ease;
  outline: none;
}

input:focus {
  border-color: var(--color-student-primary);
  box-shadow: 0 0 0 3px var(--color-input-focus-shadow);
}

input::placeholder {
  color: var(--color-text-dark-tertiary);
}

.eye-button {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.eye-button:hover {
  background: rgba(115, 44, 221, 0.1);
}

.eye-icon {
  width: 20px;
  height: 20px;
  color: var(--color-text-dark-tertiary);
  transition: color 0.3s ease;
}

.eye-button:hover .eye-icon {
  color: var(--color-student-primary);
}

.submit-btn, .start-quiz-btn {
  width: 100%;
  background-color: var(--color-student-primary);
  border: none;
  padding: 16px 24px;
  color: var(--color-text-on-primary);
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-family-base);
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.25s ease-out;
  clip-path: polygon(
    0% 0%,
    100% 0%,
    100% calc(100% - 12px),
    calc(100% - 12px) 100%,
    0% 100%
  );
}

.submit-btn:hover, .start-quiz-btn:hover {
  background-color: var(--color-student-secondary);
  transform: translateY(-3px);
  filter: drop-shadow(0 4px 10px var(--shadow-glow-student));
}

.submit-btn:focus-visible, .start-quiz-btn:focus-visible {
  outline: 3px solid var(--color-student-primary);
  outline-offset: 4px;
  background-color: var(--color-student-secondary);
  filter: drop-shadow(0 4px 10px var(--shadow-glow-student));
}

.submit-btn:active, .start-quiz-btn:active {
  transform: translateY(0);
}

.help-text {
  color: var(--color-text-dark-tertiary);
  font-size: 0.9rem;
  margin-top: 24px;
  font-weight: 400;
}

.error-message {
  display: none;
  background: var(--color-error-bg);
  border: 1px solid var(--color-error-border);
  border-radius: var(--border-radius-small);
  padding: 12px 16px;
  margin-bottom: 20px;
  color: var(--color-error);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  align-items: center;
  gap: 10px;
}

.error-message.show {
  display: flex;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.error-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.success-screen {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--color-surface);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.success-screen.show {
  display: flex;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.success-container {
  animation: slideUp 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  text-align: center;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.success-icon {
  width: 80px;
  height: 80px;
  color: var(--color-success);
  margin-bottom: 24px;
  filter: drop-shadow(0 0 20px var(--color-success-glow));
  animation: checkmark 0.6s ease 0.3s both;
}

@keyframes checkmark {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

.loading {
  pointer-events: none;
  opacity: 0.8;
}

#btnText {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.loading #btnText::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid rgba(239, 239, 244, 0.3);
  border-radius: 50%;
  border-top-color: var(--color-text-on-primary);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
  .container {
    padding: 32px;
  }
  h1 {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 16px; 
    align-items: flex-start; 
    overflow-y: auto;
  }
  .container {
    margin: 0; 
    padding: 32px 24px;
    max-width: 100%;
  }
  h1 {
    font-size: 1.75rem;
  }
  .subtitle {
    font-size: 0.9rem;
  }
  .submit-btn, .start-quiz-btn {
    padding: 14px 20px;
    font-size: 1rem;
  }
}