/* ===== ERROR ALERTS ===== */
.alert-error {
  background: #fed7d7;
  color: #c53030;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border-left: 4px solid #f56565;
}

.alert-error ul {
  margin: 0.5rem 0 0 1.5rem;
  padding: 0;
}

.alert-error li {
  margin: 0.25rem 0;
}

/* ===== INSTRUCTOR REGISTER LINK ===== */
.instructor-register-link {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.instructor-register-link a {
  color: #764ba2;
  font-weight: bold;
  text-decoration: none;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.instructor-register-link a:hover {
  text-decoration: underline;
  background: linear-gradient(135deg, #764ba2, #667eea);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== REGISTER CONTAINER ===== */
.main-register-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: auto;
    padding-top: 40px;
    padding-bottom: 30px;
}

.register-container {
  background: var(--card);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 450px; /* default (mobile-first) */
  border: 1px solid var(--border);
}

.register-container h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  color: var(--text);
}

/* ===== SOCIAL LOGIN SECTION ===== */
.social-login-section {
  margin-bottom: 1.5rem;
}

.social-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.social-btn:hover {
  background: var(--card);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.social-btn:active {
  transform: translateY(0);
}

.social-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.google-btn:hover {
  border-color: #4285F4;
  box-shadow: 0 4px 12px rgba(66, 133, 244, 0.2);
}

.apple-btn:hover {
  border-color: #000000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.divider {
  position: relative;
  text-align: center;
  margin: 1.5rem 0;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}

.divider span {
  background: var(--card);
  color: var(--muted);
  padding: 0 1rem;
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}

/* ===== PASSWORD EYE TOGGLE ===== */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  width: 100%;
  padding-right: 40px; /* space for eye icon */
}

.toggle-password {
  position: absolute;
  right: 10px;
  cursor: pointer;
  color: var(--muted);
  font-size: 1rem;
}
.toggle-password:hover {
  color: var(--text);
}

/* ===== FORM FIELDS ===== */
.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  color: var(--text);
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 1rem;
  outline: none;
  transition: 0.3s;
  background: var(--surface);
  color: var(--text);
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}

/* ===== CHECKBOX ===== */
.checkbox-group {
  display: flex;
  align-items: center;
}

.checkbox-group input {
  width: auto;
  margin-right: 10px;
}

.checkbox-group label {
  color: var(--text);
  margin-bottom: 0;
  font-weight: normal;
}

/* ===== BUTTON ===== */
.register-btn {
  width: 100%;
  padding: 0.9rem;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  font-size: 1.1rem;
  font-weight: bold;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: 0.3s;
}

.register-btn:hover {
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
}

/* ===== LOGIN LINK ===== */
.login-link {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.login-link a {
  color: var(--primary);
  font-weight: bold;
  text-decoration: none;
}

.login-link a:hover {
  text-decoration: underline;
  color: var(--primary-2);
}

/* ===== ERROR MESSAGES ===== */
.error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 5px;
}

.help-text {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-top: 0.25rem;
  display: block;
  font-style: italic;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet screens */
@media screen and (max-width: 1024px) {
  .main-register-container {
    padding: 20px;
  }
  .register-container {
    max-width: 500px;
  }
}

/* Mobile screens */
@media screen and (max-width: 768px) {
  .main-register-container {
    padding: 15px;
  }
  .register-container {
    max-width: 100%;
  }
}

/* Larger tablets and desktops (more than 1024px) */
@media screen and (min-width: 1024px) {
  .register-container {
    max-width: 700px; /* increased width for bigger screens */
  }

  form {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 columns */
    gap: 1rem 1.5rem; /* vertical + horizontal spacing */
  }

  /* make checkbox, button, and login link span full width */
  .checkbox-group,
  .register-btn,
  .login-link {
    grid-column: 1 / -1;
  }
}


/* ===== INSTRUCTOR INFO DISPLAY ===== */
.instructor-info {
    margin-top: 8px;
    padding: 12px;
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border: 2px solid #2196f3;
    border-radius: 8px;
    animation: slideIn 0.3s ease-out;
}

.instructor-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.instructor-icon {
    font-size: 18px;
}

.instructor-name {
    font-weight: 600;
    color: #1976d2;
    font-size: 14px;
}

.instructor-info.valid {
    background: linear-gradient(135deg, #e8f5e8 0%, #f1f8e9 100%);
    border-color: #4caf50;
}

.instructor-info.invalid {
    background: linear-gradient(135deg, #ffebee 0%, #fce4ec 100%);
    border-color: #f44336;
}

.instructor-info.invalid .instructor-name {
    color: #d32f2f;
}

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

/* Dark theme support */
[data-theme='dark'] .instructor-info {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d1b3d 100%);
    border-color: #64b5f6;
}

[data-theme='dark'] .instructor-info.valid {
    background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%);
    border-color: #81c784;
}

[data-theme='dark'] .instructor-info.invalid {
    background: linear-gradient(135deg, #5d1a1a 0%, #7d2d3a 100%);
    border-color: #e57373;
}

[data-theme='dark'] .instructor-name {
    color: #90caf9;
}

[data-theme='dark'] .instructor-info.invalid .instructor-name {
    color: #ef9a9a;
}


/* ===== REGISTRATION INFO CARD ===== */
.registration-info {
    margin-bottom: 2rem;
}

.info-card {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border: 2px solid #2196f3;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideIn 0.3s ease-out;
}

.info-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.info-content h3 {
    margin: 0 0 0.5rem 0;
    color: #1976d2;
    font-size: 1.1rem;
    font-weight: 600;
}

.info-content p {
    margin: 0;
    color: #424242;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Dark theme support */
[data-theme='dark'] .info-card {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d1b3d 100%);
    border-color: #64b5f6;
}

[data-theme='dark'] .info-content h3 {
    color: #90caf9;
}

[data-theme='dark'] .info-content p {
    color: #e0e0e0;
}

/* Terms and Conditions Modal Styles */
.terms-link {
    color: var(--primary-color);
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.3s ease;
}

.terms-link:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

.terms-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.terms-modal-content {
    background: #ffffff;
    margin: 2% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease-out;
}

.terms-modal-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.terms-modal-header h2 {
    margin: 0;
    color: #1a202c;
    font-size: 1.5rem;
    font-weight: 700;
}

.terms-close {
    color: #64748b;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    padding: 0.25rem;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.terms-close:hover {
    color: #dc2626;
    background: #fef2f2;
    transform: scale(1.1);
}

.terms-modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    max-height: calc(90vh - 140px);
    background: #ffffff;
}

.terms-content {
    color: #374151;
    line-height: 1.7;
}

.terms-content h3 {
    color: #1e40af;
    margin: 1.5rem 0 0.75rem 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.terms-content h3:first-child {
    margin-top: 0;
}

.terms-content p {
    margin: 0 0 1rem 0;
    color: #4b5563;
    font-size: 0.95rem;
}

.terms-content ul {
    margin: 0.5rem 0 1rem 1.5rem;
    color: #4b5563;
}

.terms-content li {
    margin: 0.25rem 0;
    font-size: 0.95rem;
}

.terms-footer {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    padding: 1.25rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    border: 1px solid #cbd5e1;
}

.terms-footer p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}

.terms-modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 16px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

.terms-modal-footer .btn {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    border-radius: 8px;
    background: #1e40af;
    color: white;
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.terms-modal-footer .btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

/* Modal Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .terms-modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 85vh;
    }
    
    .terms-modal-header {
        padding: 1rem 1.5rem;
    }
    
    .terms-modal-header h2 {
        font-size: 1.3rem;
    }
    
    .terms-modal-body {
        padding: 1.5rem;
    }
    
    .terms-modal-footer {
        padding: 1rem 1.5rem;
    }
    
    .terms-content h3 {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .terms-modal-content {
        width: 98%;
        margin: 2% auto;
        max-height: 95vh;
    }
    
    .terms-modal-header {
        padding: 0.75rem 1rem;
    }
    
    .terms-modal-body {
        padding: 1rem;
    }
    
    .terms-modal-footer {
        padding: 0.75rem 1rem;
    }
}

/* Light Theme Specific Overrides */
[data-theme='light'] .terms-modal-content {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15) !important;
}

[data-theme='light'] .terms-modal-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
    border-bottom-color: #e2e8f0 !important;
}

[data-theme='light'] .terms-modal-header h2 {
    color: #1a202c !important;
}

[data-theme='light'] .terms-close {
    color: #64748b !important;
}

[data-theme='light'] .terms-close:hover {
    color: #dc2626 !important;
    background: #fef2f2 !important;
}

[data-theme='light'] .terms-modal-body {
    background: #ffffff !important;
}

[data-theme='light'] .terms-content {
    color: #374151 !important;
}

[data-theme='light'] .terms-content h3 {
    color: #1e40af !important;
}

[data-theme='light'] .terms-content p {
    color: #4b5563 !important;
}

[data-theme='light'] .terms-content ul {
    color: #4b5563 !important;
}

[data-theme='light'] .terms-footer {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%) !important;
    border-color: #cbd5e1 !important;
}

[data-theme='light'] .terms-footer p {
    color: #64748b !important;
}

[data-theme='light'] .terms-modal-footer {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
    border-top-color: #e2e8f0 !important;
}

/* Dark Theme Support for Terms Modal */
[data-theme='dark'] .terms-modal {
    background-color: rgba(0, 0, 0, 0.8);
}

[data-theme='dark'] .terms-modal-content {
    background: #1a1a1a;
    border-color: #333;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

[data-theme='dark'] .terms-modal-header {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border-bottom-color: #333;
}

[data-theme='dark'] .terms-modal-header h2 {
    color: #ffffff;
}

[data-theme='dark'] .terms-close {
    color: #b0b0b0;
}

[data-theme='dark'] .terms-close:hover {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

[data-theme='dark'] .terms-modal-body {
    background: #1a1a1a;
}

[data-theme='dark'] .terms-content {
    color: #e0e0e0;
}

[data-theme='dark'] .terms-content h3 {
    color: #64b5f6;
}

[data-theme='dark'] .terms-content p {
    color: #b0b0b0;
}

[data-theme='dark'] .terms-content ul {
    color: #b0b0b0;
}

[data-theme='dark'] .terms-footer {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border-color: #333;
}

[data-theme='dark'] .terms-footer p {
    color: #b0b0b0;
}

[data-theme='dark'] .terms-modal-footer {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border-top-color: #333;
}
