/**
 * Captive Portal Styles
 * Lightweight CSS for WiFi authentication portal
 */

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #1e88e5;
  --secondary-color: #43a047;
  --background-color: #ffffff;
  --text-color: #333333;
  --error-color: #f44336;
  --success-color: #4caf50;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Logo styling */
.portal-logo {
  max-width: 200px;
  max-height: 80px;
  width: auto;
  height: auto;
  display: block;
  margin: 0 auto;
}

.logo-placeholder {
  font-size: 24px;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.8);
  padding: 20px;
  text-align: center;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-left-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-overlay p {
  margin-top: 20px;
  color: #666;
}

/* Error Container */
.error-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.error-card {
  background: white;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
  max-width: 400px;
}

.error-card h2 {
  color: var(--error-color);
  margin-bottom: 15px;
}

.error-card p {
  color: #666;
  margin-bottom: 25px;
}

.error-card button {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
}

.error-card button:hover {
  opacity: 0.9;
}

/* Portal Container */
.portal-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  padding: 20px;
}

/* Login Card */
.login-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  max-width: 420px;
  width: 100%;
  overflow: hidden;
  animation: slideUp 0.5s ease-out;
}

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

/* Logo Section */
.logo-section {
  background: var(--primary-color);
  padding: 40px 30px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px;
}

.portal-logo {
  max-width: 220px;
  max-height: 80px;
  height: auto;
}

.logo-placeholder {
  width: 150px;
  height: 60px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  border-radius: 8px;
  font-size: 18px;
  letter-spacing: 2px;
}

/* Content Section */
.content-section {
  padding: 40px 30px;
}

.content-section h1 {
  margin: 0 0 12px 0;
  font-size: 28px;
  color: var(--text-color);
  font-weight: 700;
}

.content-section > p {
  margin: 0 0 25px 0;
  color: #666;
  font-size: 15px;
}

/* Login Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.login-form input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 15px;
  transition: all 0.3s;
  background: #fafafa;
}

.login-form input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: white;
  box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
}

.submit-btn {
  width: 100%;
  padding: 16px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.submit-btn:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Social Login */
.social-login {
  margin-top: 25px;
  padding-top: 25px;
  border-top: 1px solid #e0e0e0;
}

.social-login p {
  text-align: center;
  color: #999;
  font-size: 13px;
  margin-bottom: 15px;
}

.social-buttons {
  display: flex;
  gap: 12px;
}

.social-btn {
  flex: 1;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s;
}

.social-btn:hover {
  border-color: var(--primary-color);
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

.social-btn.google {
  color: #db4437;
}

.social-btn.facebook {
  color: #4267B2;
}

.social-btn.twitter {
  color: #1DA1F2;
}

.social-btn.github {
  color: #333;
}

.social-btn.linkedin {
  color: #0077B5;
}

/* Terms */
.terms {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
  font-size: 11px;
  color: #999;
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.5;
}

.terms::-webkit-scrollbar {
  width: 6px;
}

.terms::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

/* Footer */
footer {
  margin-top: 25px;
  text-align: center;
  color: white;
  font-size: 13px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  padding: 15px;
}

/* Support Info */
.support-info {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
  text-align: center;
}

.support-info p {
  font-size: 12px;
  color: #999;
  margin-bottom: 8px;
}

.support-info a {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 13px;
  margin: 0 10px;
  font-weight: 500;
}

.support-info a:hover {
  text-decoration: underline;
}

/* Login Error */
.login-error {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--error-color);
  color: white;
  padding: 15px 25px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  animation: slideDown 0.3s ease-out;
  max-width: 90%;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Success Container */
.success-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  padding: 20px;
}

.success-card {
  background: white;
  padding: 60px 40px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-width: 400px;
  animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.success-icon {
  width: 80px;
  height: 80px;
  background: var(--success-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 25px;
  font-size: 48px;
  color: white;
  animation: checkmark 0.5s ease-in-out 0.3s both;
}

@keyframes checkmark {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}

.success-card h2 {
  color: var(--success-color);
  margin-bottom: 15px;
  font-size: 28px;
}

.success-card p {
  color: #666;
  font-size: 16px;
  margin-bottom: 10px;
}

.redirect-message {
  color: #999;
  font-size: 14px;
  margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 480px) {
  .login-card {
    border-radius: 12px;
  }
  
  .logo-section {
    padding: 30px 20px;
  }
  
  .content-section {
    padding: 30px 20px;
  }
  
  .content-section h1 {
    font-size: 24px;
  }
  
  .login-form input {
    padding: 12px 14px;
  }
  
  .submit-btn {
    padding: 14px;
  }
}

/* Print Styles */
@media print {
  body {
    background: white;
  }
  
  .loading-overlay,
  .login-error,
  .social-login {
    display: none !important;
  }
}
