/* ========================================
   Islamic Geometric Pattern Login Page
   Color Scheme: Deep Teal #0d5c63, Black #1a1a1a, White #ffffff, Gold #d4af37
======================================== */

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body.login-body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #0d5c63;
  background-image: url('/images/background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Pattern Overlay */
.login-pattern-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(13, 92, 99, 0.85) 0%, rgba(26, 26, 26, 0.75) 100%);
  z-index: 1;
  pointer-events: none;
}

/* Login Container */
.login-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Login Card */
.login-card {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4),
              0 0 0 1px rgba(212, 175, 55, 0.3);
  padding: 48px 40px;
  width: 100%;
  backdrop-filter: blur(10px);
  clip-path: polygon(
    0% 16px,
    16px 0%,
    calc(100% - 16px) 0%,
    100% 16px,
    100% calc(100% - 16px),
    calc(100% - 16px) 100%,
    16px 100%,
    0% calc(100% - 16px)
  );
}

/* Logo Section */
.logo-section {
  text-align: center;
  margin-bottom: 36px;
}

.geometric-logo {
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
  filter: drop-shadow(0 4px 12px rgba(13, 92, 99, 0.3));
  animation: fadeInDown 0.8s ease-out;
}

.logo-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.app-title {
  font-size: 28px;
  color: #0d5c63;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin: 0;
  text-transform: uppercase;
  animation: fadeIn 1s ease-out 0.2s both;
}

/* Login Form Wrapper */
.login-form-wrapper {
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

.login-title {
  font-size: 24px;
  color: #1a1a1a;
  font-weight: 600;
  margin-bottom: 28px;
  text-align: center;
  position: relative;
  padding-bottom: 16px;
}

.login-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #d4af37, transparent);
}

/* Error Message */
.error-message {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-left: 4px solid #dc2626;
  color: #991b1b;
  padding: 14px 16px;
  margin-bottom: 24px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  animation: shake 0.5s ease-in-out;
}

.error-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* Form Styles */
.login-form {
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  width: 20px;
  height: 20px;
  color: #0d5c63;
  pointer-events: none;
  z-index: 1;
}

.input-wrapper input {
  width: 100%;
  padding: 14px 16px 14px 48px;
  font-size: 15px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
  color: #1a1a1a;
  transition: all 0.3s ease;
  font-family: inherit;
}

.input-wrapper input:focus {
  outline: none;
  border-color: #0d5c63;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(13, 92, 99, 0.1);
}

.input-wrapper input::placeholder {
  color: #9ca3af;
}

/* Login Button */
.login-button {
  width: 100%;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, #0d5c63 0%, #0a4a52 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  clip-path: polygon(
    0% 8px,
    8px 0%,
    calc(100% - 8px) 0%,
    100% 8px,
    100% calc(100% - 8px),
    calc(100% - 8px) 100%,
    8px 100%,
    0% calc(100% - 8px)
  );
}

.login-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.login-button:hover::before {
  left: 100%;
}

.login-button:hover {
  background: linear-gradient(135deg, #0a4a52 0%, #083d43 100%);
  box-shadow: 0 8px 20px rgba(13, 92, 99, 0.4);
  transform: translateY(-2px);
}

.login-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(13, 92, 99, 0.3);
}

.button-icon {
  width: 20px;
  height: 20px;
}

/* Language Switcher */
.language-switcher {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.language-switcher a {
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  text-decoration: none;
  transition: color 0.3s ease;
  position: relative;
}

.language-switcher a:hover {
  color: #0d5c63;
}

.language-switcher a.active {
  color: #0d5c63;
  font-weight: 600;
}

.language-switcher a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: #d4af37;
}

.language-switcher .separator {
  color: #d1d5db;
}

/* RTL Support */
body.rtl .input-wrapper input {
  padding: 14px 48px 14px 16px;
}

body.rtl .input-icon {
  left: auto;
  right: 16px;
}

body.rtl .error-message {
  border-left: none;
  border-right: 4px solid #dc2626;
}

body.rtl .button-icon {
  transform: rotate(180deg);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 540px) {
  .login-container {
    padding: 16px;
  }

  .login-card {
    padding: 36px 28px;
  }

  .geometric-logo {
    width: 100px;
    height: 100px;
  }

  .app-title {
    font-size: 24px;
  }

  .login-title {
    font-size: 20px;
  }
}

@media (max-height: 700px) {
  .login-card {
    padding: 32px 36px;
  }

  .geometric-logo {
    width: 90px;
    height: 90px;
    margin-bottom: 16px;
  }

  .app-title {
    font-size: 22px;
  }

  .logo-section {
    margin-bottom: 24px;
  }

  .form-group {
    margin-bottom: 18px;
  }
}
