/* =====================================================
   AUTHENTICATION - Design Moderne Frigotop
   Login, Register, Forgot/Reset Password, Logout
   ===================================================== */

:root {
  --auth-primary: #004080;
  --auth-primary-dark: #002a5c;
  --auth-accent: #ff9933;
  --auth-accent-hover: #ff7711;
  --auth-bg-gradient: linear-gradient(135deg, #004080 0%, #0066cc 50%, #0080ff 100%);
  --auth-white: #ffffff;
  --auth-gray-100: #f8f9fa;
  --auth-gray-200: #e9ecef;
  --auth-gray-300: #dee2e6;
  --auth-gray-500: #adb5bd;
  --auth-gray-700: #495057;
  --auth-gray-900: #212529;
  --auth-success: #28a745;
  --auth-danger: #dc3545;
  --auth-shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --auth-shadow-md: 0 4px 20px rgba(0,0,0,0.1);
  --auth-shadow-lg: 0 10px 40px rgba(0,64,128,0.2);
  --auth-radius: 16px;
  --auth-radius-sm: 8px;
  --auth-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Page Layout */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--auth-bg-gradient);
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
  animation: authPulse 15s ease-in-out infinite;
}

@keyframes authPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

/* Auth Container */
.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
}

.auth-card {
  background: var(--auth-white);
  border-radius: var(--auth-radius);
  box-shadow: var(--auth-shadow-lg);
  overflow: hidden;
  animation: authSlideUp 0.5s ease-out;
}

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

/* Card Header */
.auth-card-header {
  background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-primary-dark) 100%);
  padding: 40px 30px 30px;
  text-align: center;
  position: relative;
}

.auth-card-header::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 0;
  right: 0;
  height: 40px;
  background: var(--auth-white);
  border-radius: 50% 50% 0 0;
}

.auth-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: var(--auth-white);
  border-radius: 50%;
  padding: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.auth-card-header h1 {
  color: var(--auth-white);
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
}

.auth-card-header p {
  color: rgba(255,255,255,0.8);
  font-size: 0.95rem;
  margin: 10px 0 0;
}

/* Card Body */
.auth-card-body {
  padding: 30px;
}

/* Form Elements */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--auth-gray-700);
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-label i {
  color: var(--auth-primary);
  font-size: 1rem;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--auth-gray-200);
  border-radius: var(--auth-radius-sm);
  font-size: 1rem;
  transition: var(--auth-transition);
  background: var(--auth-gray-100);
}

.form-input:focus {
  outline: none;
  border-color: var(--auth-primary);
  background: var(--auth-white);
  box-shadow: 0 0 0 4px rgba(0,64,128,0.1);
}

.form-input::placeholder {
  color: var(--auth-gray-500);
}

/* Input with Icon */
.input-group {
  position: relative;
}

.input-group .form-input {
  padding-left: 45px;
}

.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--auth-gray-500);
  font-size: 1.1rem;
}

.input-group:focus-within .input-icon {
  color: var(--auth-primary);
}

/* Password Toggle */
.password-toggle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--auth-gray-500);
  cursor: pointer;
  padding: 5px;
  font-size: 1.1rem;
  transition: var(--auth-transition);
}

.password-toggle:hover {
  color: var(--auth-primary);
}

.input-group .form-input.has-toggle {
  padding-right: 45px;
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--auth-gray-700);
}

.form-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  border: 2px solid var(--auth-gray-300);
  border-radius: 4px;
  cursor: pointer;
  accent-color: var(--auth-primary);
}

/* Buttons */
.auth-btn {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: var(--auth-radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--auth-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.auth-btn-primary {
  background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-primary-dark) 100%);
  color: var(--auth-white);
  box-shadow: 0 4px 15px rgba(0,64,128,0.3);
}

.auth-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,64,128,0.4);
}

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

.auth-btn-accent {
  background: linear-gradient(135deg, var(--auth-accent) 0%, var(--auth-accent-hover) 100%);
  color: var(--auth-white);
  box-shadow: 0 4px 15px rgba(255,153,51,0.3);
}

.auth-btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255,153,51,0.4);
}

.auth-btn-outline {
  background: transparent;
  color: var(--auth-primary);
  border: 2px solid var(--auth-primary);
}

.auth-btn-outline:hover {
  background: var(--auth-primary);
  color: var(--auth-white);
}

/* Links */
.auth-link {
  color: var(--auth-primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--auth-transition);
}

.auth-link:hover {
  color: var(--auth-accent);
  text-decoration: underline;
}

/* Forgot Password Link */
.forgot-password {
  text-align: right;
  font-size: 0.875rem;
  margin-top: -10px;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 20px 0;
  color: var(--auth-gray-500);
  font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--auth-gray-200);
}

/* Social Login */
.social-login {
  display: flex;
  gap: 12px;
}

.social-btn {
  flex: 1;
  padding: 12px;
  border: 2px solid var(--auth-gray-200);
  border-radius: var(--auth-radius-sm);
  background: var(--auth-white);
  cursor: pointer;
  transition: var(--auth-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.social-btn:hover {
  border-color: var(--auth-primary);
  background: var(--auth-gray-100);
}

.social-btn.google { color: #db4437; }
.social-btn.facebook { color: #4267B2; }
.social-btn.apple { color: #000; }

/* Card Footer */
.auth-card-footer {
  padding: 20px 30px;
  background: var(--auth-gray-100);
  border-top: 1px solid var(--auth-gray-200);
  text-align: center;
  font-size: 0.95rem;
  color: var(--auth-gray-700);
}

/* Alerts */
.auth-alert {
  padding: 14px 18px;
  border-radius: var(--auth-radius-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  animation: authSlideIn 0.3s ease-out;
}

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

.auth-alert-success {
  background: rgba(40, 167, 69, 0.1);
  border: 1px solid var(--auth-success);
  color: var(--auth-success);
}

.auth-alert-error {
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid var(--auth-danger);
  color: var(--auth-danger);
}

.auth-alert i {
  font-size: 1.1rem;
}

/* Logout Page */
.logout-container {
  text-align: center;
  padding: 40px 30px;
}

.logout-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto 30px;
  background: linear-gradient(135deg, var(--auth-accent) 0%, var(--auth-accent-hover) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--auth-white);
  box-shadow: 0 10px 30px rgba(255,153,51,0.3);
  animation: logoutBounce 0.6s ease-out;
}

@keyframes logoutBounce {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.logout-container h2 {
  color: var(--auth-gray-900);
  font-size: 1.75rem;
  margin-bottom: 10px;
}

.logout-container p {
  color: var(--auth-gray-500);
  margin-bottom: 30px;
}

.logout-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}

/* Form Row (for side-by-side inputs) */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

/* Terms Checkbox */
.terms-text {
  font-size: 0.85rem;
  color: var(--auth-gray-500);
  line-height: 1.5;
}

.terms-text a {
  color: var(--auth-primary);
  font-weight: 600;
}

/* Back Link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--auth-gray-500);
  font-size: 0.9rem;
  text-decoration: none;
  transition: var(--auth-transition);
  margin-bottom: 20px;
}

.back-link:hover {
  color: var(--auth-primary);
}

/* Responsive */
@media (max-width: 480px) {
  .auth-page {
    padding: 20px 15px;
  }
  
  .auth-card-header {
    padding: 30px 20px 25px;
  }
  
  .auth-card-header h1 {
    font-size: 1.5rem;
  }
  
  .auth-card-body {
    padding: 25px 20px;
  }
  
  .auth-logo {
    width: 70px;
    height: 70px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .logout-actions {
    flex-direction: column;
  }
}

/* Loading State */
.auth-btn.loading {
  pointer-events: none;
  opacity: 0.8;
}

.auth-btn.loading::after {
  content: '';
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: var(--auth-white);
  border-radius: 50%;
  animation: authSpin 0.8s linear infinite;
}

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