/* =====================================
   LOGIN PAGE STYLING - KADER PARU
   Desain Responsif untuk Web & Mobile
   ===================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #1abc9c;
  --primary-dark: #16a085;
  --secondary-color: #0984e3;
  --danger-color: #e74c3c;
  --success-color: #27ae60;
  --light-bg: #ecf0f1;
  --white: #ffffff;
  --text-dark: #2c3e50;
  --text-light: #7f8c8d;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 15px 50px rgba(0, 0, 0, 0.15);
  --transition: all 0.3s ease-in-out;
}

/* ===== BACKGROUND & LAYOUT ===== */
html, body {
  height: 100%;
  width: 100%;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  min-height: 100vh;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* ===== CONTAINER UTAMA ===== */
.login-container {
  width: 100%;
  max-width: 450px;
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: slideInUp 0.6s ease-out;
}

/* ===== HEADER SECTION ===== */
.login-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  padding: 40px 20px;
  text-align: center;
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.login-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

.login-header::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -30%;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  animation: float 8s ease-in-out infinite reverse;
}

.logo-icon {
  position: relative;
  z-index: 1;
  font-size: 60px;
  margin-bottom: 15px;
  display: inline-block;
  animation: bounce 2s ease-in-out infinite;
}

.login-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
  letter-spacing: 0.5px;
}

.login-subtitle {
  font-size: 13px;
  opacity: 0.9;
  position: relative;
  z-index: 1;
  font-weight: 300;
  letter-spacing: 0.3px;
}

/* ===== FORM SECTION ===== */
.login-body {
  padding: 40px 30px;
}

.form-group {
  margin-bottom: 25px;
  animation: slideInUp 0.6s ease-out;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }

.form-label {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-label i {
  margin-right: 8px;
  color: var(--primary-color);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input {
  width: 100%;
  padding: 12px 15px 12px 45px;
  border: 2px solid var(--light-bg);
  border-radius: 10px;
  font-size: 15px;
  color: var(--text-dark);
  background: #f8f9fa;
  transition: var(--transition);
  font-family: inherit;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(26, 188, 156, 0.1);
}

.form-input::placeholder {
  color: var(--text-light);
}

.input-icon {
  position: absolute;
  left: 15px;
  color: var(--text-light);
  font-size: 18px;
  transition: var(--transition);
  pointer-events: none;
}

.form-input:focus ~ .input-icon,
.form-input:not(:placeholder-shown) ~ .input-icon {
  color: var(--primary-color);
}

/* ===== REMEMBER & FORGOT ===== */
.form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  font-size: 14px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.remember-me input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.forgot-password {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
}

.forgot-password:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ===== BUTTON LOGIN ===== */
.btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.btn-login::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: left 0.5s ease;
}

.btn-login:hover::before {
  left: 100%;
}

.btn-login:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.btn-login:active {
  transform: translateY(-1px);
}

.btn-login i {
  font-size: 18px;
}

.btn-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-login .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn-login.loading .spinner {
  display: block;
}

.btn-login.loading i {
  display: none;
}

/* ===== ERROR & SUCCESS MESSAGES ===== */
.alert {
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInDown 0.4s ease-out;
  font-size: 14px;
  font-weight: 500;
  position: relative;
}

.alert-error {
  background: #fadbd8;
  color: var(--danger-color);
  border-left: 4px solid var(--danger-color);
}

.alert-warning {
  background: #fef5e7;
  color: #d68910;
  border-left: 4px solid #f39c12;
}

.alert-success {
  background: #d5f4e6;
  color: var(--success-color);
  border-left: 4px solid var(--success-color);
}

.alert i {
  font-size: 18px;
  flex-shrink: 0;
}

.alert-close {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 16px;
  padding: 0 5px;
  margin-left: auto;
  opacity: 0.7;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
}

.alert-close:hover {
  opacity: 1;
}

/* ===== FOOTER SECTION ===== */
.login-footer {
  padding: 20px 30px;
  background: #f8f9fa;
  text-align: center;
  border-top: 1px solid var(--light-bg);
  font-size: 14px;
  color: var(--text-light);
}

.login-footer a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.login-footer a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ===== ANIMATIONS ===== */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(20px, -20px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== RESPONSIVE MOBILE ===== */
@media (max-width: 768px) {
  .login-container {
    max-width: 100%;
    border-radius: 15px;
  }

  .login-header {
    padding: 30px 20px;
  }

  .logo-icon {
    font-size: 48px;
  }

  .login-title {
    font-size: 24px;
  }

  .login-subtitle {
    font-size: 12px;
  }

  .login-body {
    padding: 30px 20px;
  }

  .form-label {
    font-size: 12px;
  }

  .form-input {
    padding: 11px 12px 11px 40px;
    font-size: 14px;
  }

  .btn-login {
    padding: 12px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 15px;
  }

  .login-header {
    padding: 25px 15px;
  }

  .logo-icon {
    font-size: 40px;
    margin-bottom: 10px;
  }

  .login-title {
    font-size: 20px;
    margin-bottom: 8px;
  }

  .login-subtitle {
    font-size: 11px;
  }

  .login-body {
    padding: 25px 15px;
  }

  .form-group {
    margin-bottom: 18px;
  }

  .form-footer {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .remember-me,
  .forgot-password {
    font-size: 13px;
  }

  .login-footer {
    padding: 15px;
    font-size: 12px;
  }
}

/* ===== TABLET ===== */
@media (max-width: 1024px) and (min-width: 769px) {
  .login-container {
    max-width: 400px;
  }

  .login-body {
    padding: 35px 25px;
  }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== DARK MODE (Optional) ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --white: #1a1a1a;
    --text-dark: #ecf0f1;
    --text-light: #95a5a6;
    --light-bg: #2c3e50;
  }

  .login-container {
    background: #2c3e50;
  }

  .form-input {
    background: #34495e;
    border-color: #34495e;
    color: var(--text-dark);
  }

  .form-input:focus {
    background: #3d5467;
  }

  .login-footer {
    background: #34495e;
    border-top-color: #34495e;
  }

  .alert-error {
    background: rgba(231, 76, 60, 0.2);
  }

  .alert-success {
    background: rgba(39, 174, 96, 0.2);
  }
}
/* ===== ALERT MESSAGES ===== */
#alertContainer {
  margin-bottom: 20px;
}

.alert {
  padding: 16px;
  margin-bottom: 16px;
  border-radius: 12px;
  border-left: 4px solid;
  animation: slideInDown 0.4s ease-out;
  transition: all 0.3s ease;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  justify-content: space-between;
}

.alert-error {
  background-color: rgba(231, 76, 60, 0.1);
  border-left-color: var(--danger-color);
  color: #a93226;
}

.alert-success {
  background-color: rgba(39, 174, 96, 0.1);
  border-left-color: var(--success-color);
  color: #1e8449;
}

.alert-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-text {
  flex: 1;
}

.alert-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.alert-message {
  font-size: 13px;
  opacity: 0.9;
}

.alert-close {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 16px;
  opacity: 0.6;
  transition: opacity 0.3s ease;
  padding: 4px 8px;
  flex-shrink: 0;
}

.alert-close:hover {
  opacity: 1;
}

/* ===== ERROR TEXT UNTUK FIELD ===== */
.error-text {
  display: block;
  color: var(--danger-color);
  font-size: 12px;
  margin-top: 6px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.form-input.is-invalid {
  border-color: var(--danger-color) !important;
  box-shadow: 0 0 8px rgba(231, 76, 60, 0.2) !important;
}

/* ===== DEMO INFO ALERT ===== */
.demo-info {
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(26, 188, 156, 0.1) 100%);
  border-radius: 12px;
  border-left: 4px solid var(--secondary-color);
  padding: 14px 16px;
  margin-bottom: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.demo-info:hover {
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.15) 0%, rgba(26, 188, 156, 0.15) 100%);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.demo-info-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary-color);
  margin-bottom: 8px;
}

.demo-info-header i {
  font-size: 16px;
}

.demo-info-content {
  font-size: 12px;
  color: #2c3e50;
  margin: 0;
}

.demo-info-content p {
  margin: 4px 0;
  line-height: 1.4;
}

.demo-info-content strong {
  color: var(--secondary-color);
}

/* ===== DEMO MODAL ===== */
.demo-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.demo-modal {
  background: var(--white);
  border-radius: 16px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.demo-modal-header {
  padding: 20px;
  border-bottom: 1px solid #ecf0f1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.demo-modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--text-light);
  transition: color 0.3s ease;
  padding: 0;
}

.modal-close:hover {
  color: var(--text-dark);
}

.demo-modal-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.demo-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #f8f9fa;
  border: 2px solid #ecf0f1;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  font-family: inherit;
}

.demo-btn:hover {
  border-color: var(--secondary-color);
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.05) 0%, rgba(26, 188, 156, 0.05) 100%);
}

.demo-btn:active {
  transform: scale(0.98);
}

.demo-btn i {
  font-size: 24px;
  color: var(--secondary-color);
  flex-shrink: 0;
}

.demo-btn-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
}

.demo-btn-subtitle {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

/* ===== RESPONSIVE ALERTS ===== */
@media (max-width: 576px) {
  .alert {
    padding: 12px;
    margin-bottom: 12px;
  }

  .alert-content {
    flex-wrap: wrap;
  }

  .alert-icon {
    font-size: 18px;
  }

  .alert-title {
    font-size: 13px;
  }

  .alert-message {
    font-size: 12px;
  }

  .demo-info {
    padding: 12px 14px;
    margin-bottom: 16px;
  }

  .demo-info-header {
    font-size: 12px;
    margin-bottom: 6px;
  }

  .demo-info-content {
    font-size: 11px;
  }

  .demo-modal {
    max-width: 320px;
  }

  .demo-modal-header {
    padding: 16px;
  }

  .demo-modal-header h3 {
    font-size: 15px;
  }

  .demo-btn {
    padding: 12px 14px;
    gap: 10px;
  }

  .demo-btn i {
    font-size: 20px;
  }

  .demo-btn-title {
    font-size: 13px;
  }

  .demo-btn-subtitle {
    font-size: 10px;
  }
}

/* ===== FORGOT PASSWORD MODAL STYLING ===== */
.forgot-password-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.forgot-password-modal {
  background: var(--white);
  border-radius: 20px;
  padding: 40px 30px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.forgot-password-modal .modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 24px;
  color: var(--text-light);
  transition: var(--transition);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  hover: all 0.3s ease;
}

.forgot-password-modal .modal-close:hover {
  background: var(--light-bg);
  color: var(--text-dark);
}

.forgot-password-modal .modal-icon {
  text-align: center;
  font-size: 60px;
  color: var(--primary-color);
  margin-bottom: 20px;
  animation: bounce 0.6s ease-out;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.forgot-password-modal .modal-title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 15px;
}

.forgot-password-modal .modal-message {
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 30px;
  line-height: 1.6;
}

.forgot-password-modal .modal-admin-contact {
  background: linear-gradient(135deg, rgba(26, 188, 156, 0.05) 0%, rgba(9, 132, 227, 0.05) 100%);
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 25px;
  border: 2px solid rgba(26, 188, 156, 0.1);
}

.contact-section {
  margin-bottom: 20px;
}

.contact-section:last-child {
  margin-bottom: 0;
}

.contact-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.contact-label i {
  color: var(--primary-color);
  font-size: 14px;
}

.contact-value {
  font-size: 14px;
  color: var(--text-dark);
  font-weight: 500;
  line-height: 1.6;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(26, 188, 156, 0.1);
}

.contact-link:hover {
  background: rgba(26, 188, 156, 0.2);
  transform: translateX(5px);
}

.contact-link i {
  font-size: 16px;
}

.contact-divider {
  text-align: center;
  color: var(--text-light);
  font-size: 12px;
  margin: 15px 0;
  font-weight: 500;
}

.forgot-password-modal .modal-note {
  background: rgba(241, 196, 15, 0.1);
  border-left: 4px solid #f1c40f;
  padding: 12px 15px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-dark);
  margin-bottom: 25px;
  display: flex;
  gap: 10px;
}

.modal-note i {
  color: #f1c40f;
  flex-shrink: 0;
  font-size: 14px;
  margin-top: 2px;
}

.forgot-password-modal .modal-action-btn {
  width: 100%;
  padding: 14px;
  border: none;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: var(--white);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 5px 15px rgba(26, 188, 156, 0.3);
}

.modal-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(26, 188, 156, 0.4);
}

.modal-action-btn i {
  font-size: 16px;
}

/* Responsive untuk tablet & mobile */
@media (max-width: 768px) {
  .forgot-password-modal {
    padding: 30px 20px;
    margin: 20px;
  }

  .forgot-password-modal .modal-icon {
    font-size: 48px;
    margin-bottom: 15px;
  }

  .forgot-password-modal .modal-title {
    font-size: 20px;
    margin-bottom: 12px;
  }

  .forgot-password-modal .modal-message {
    font-size: 13px;
    margin-bottom: 20px;
  }

  .forgot-password-modal .modal-admin-contact {
    padding: 18px;
    margin-bottom: 20px;
  }

  .contact-section {
    margin-bottom: 15px;
  }

  .contact-label {
    font-size: 11px;
    margin-bottom: 8px;
  }

  .contact-value {
    font-size: 13px;
  }

  .contact-link {
    padding: 6px 10px;
    font-size: 13px;
  }

  .contact-divider {
    margin: 12px 0;
  }

  .forgot-password-modal .modal-note {
    padding: 10px 12px;
    font-size: 11px;
    margin-bottom: 20px;
  }

  .modal-note i {
    font-size: 13px;
  }

  .forgot-password-modal .modal-action-btn {
    padding: 12px;
    font-size: 13px;
  }
}