/* 
==========================================
  VARIABLES AND RESET
==========================================
*/

:root {
  /* Colors - Dark Theme (Default) */
  --bg-primary: #02090D;
  --bg-secondary: rgba(183.60, 207.20, 224.40, 0.12);
  --text-primary: #D7DFE4;
  --text-secondary: rgba(208.59, 223.93, 235.11, 0.62);
  --text-placeholder: rgba(208.59, 223.93, 235.11, 0.40);
  --accent-color: #0D99FF;
  --social-bg: #828E97;
  --input-bg: rgba(183.60, 207.20, 224.40, 0.12);
  --border-color: rgba(255, 255, 255, 0);
  --error-color: #ff4d4d;

  /* Colors - Light Theme */
  --bg-primary-light: #FBFDFE;
  --bg-secondary-light: #F5F5F5;
  --text-primary-light: #02090D;
  --text-secondary-light: #656565;
  --text-placeholder-light: #9CA3AF;
  --social-bg-light: #ECECEC;
  --input-bg-light: #F9FAFB;

  /* Typography */
  --font-family: 'Public Sans', sans-serif;
  --font-size-small: 13px;
  --font-size-regular: 15px;
  --font-size-large: 28px;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;
  --line-height-small: 16px;
  --line-height-regular: 20px;
  --line-height-large: 32px;

  /* Spacing */
  --spacing-xs: 8px;
  --spacing-sm: 12px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-xxl: 48px;

  /* Radius */
  --border-radius: 8px;
  
  /* Transition */
  --theme-transition-duration: 300ms;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Theme transition class - applied during theme changes */
html.theme-transition,
html.theme-transition *,
html.theme-transition *:before,
html.theme-transition *:after {
  transition: all var(--theme-transition-duration) ease !important;
  transition-delay: 0 !important;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 
==========================================
LIGHT THEME STYLES
==========================================
*/

body.light-theme {
  background-color: var(--bg-primary-light);
  color: var(--text-primary-light);
}

.light-theme .header {
  background-color: var(--bg-primary-light);
}

.light-theme .dark-icon {
  display: none;
}

.light-theme .light-icon {
  display: block;
  color: var(--text-primary-light); /* This makes the sun icon dark in light mode */
}

.light-theme .login-form input {
  background-color: var(--input-bg-light);
  color: var(--text-primary-light);
  border-color: rgba(52, 152, 219, 0.3);
}

.light-theme .login-form input::placeholder {
  color: var(--text-placeholder-light);
}

.light-theme .social-icon {
  background-color: var(--social-bg-light);
}

.light-theme .login-btn {
  color: #F9F9F9;
}

.light-theme .no-account,
.light-theme .forgot-link,
.light-theme .trouble-link,
.light-theme label {
  color: var(--text-primary-light);
}

/* 
==========================================
LAYOUT & CONTAINER STYLES
==========================================
*/

.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 48px;
}

.header {
  height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  background-color: var(--bg-primary);
}

.main-content {
  min-height: 700px;
  padding-top: 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.login-container {
  width: 100%;
  max-width: 450px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px; /* Consistent spacing throughout container */
}

/* 
==========================================
LOGO & THEME TOGGLE
==========================================
*/

.logo {
  width: 29px;
  height: 36px;
  display: flex;
  align-items: center;
}

.logo-img {
  width: 100%;
  height: auto;
}

.theme-toggle {
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-primary);
  font-size: 22px;
}

.dark-icon {
  display: block;
}

.light-icon {
  display: none;
}

/* 
==========================================
LOGIN FORM STYLES
==========================================
*/

.login-header {
  text-align: center;
  margin-bottom: 15px;
}

.login-header h1 {
  font-size: var(--font-size-large);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-large);
  margin-bottom: 8px;
}

.login-header p {
  font-size: var(--font-size-regular);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-regular);
  color: var(--text-secondary); /* Changed from var(--text-primary) to make it darker */
}

.light-theme .login-header p {
  color: var(--text-secondary-light); /* This makes it darker in light mode */
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

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

label {
  font-size: var(--font-size-regular);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-regular);
  color: var(--text-primary);
}

.login-form input {
  width: 100%;
  height: 41px;
  padding: 8px 12px;
  background-color: var(--input-bg);
  border: 1.5px solid rgba(52, 152, 219, 0.3);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-size: var(--font-size-regular);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-regular);
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.login-form input:focus {
  border-color: rgba(52, 152, 219, 0.8);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.light-theme .login-form input {
  border-color: rgba(52, 152, 219, 0.3);
}

.light-theme .login-form input:focus {
  border-color: rgba(52, 152, 219, 0.8);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

/* Password field with toggle */
.password-field {
  position: relative;
  width: 100%;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle i {
  font-size: 18px;
}

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

.light-theme .password-toggle {
  color: var(--text-secondary-light);
}

.light-theme .password-toggle:hover {
  color: var(--text-primary-light);
}

.login-form input::placeholder {
  color: var(--text-placeholder);
}

.login-btn {
  width: 100%;
  padding: 8px 16px;
  background-color: var(--accent-color);
  border: none;
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-size: var(--font-size-regular);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-regular);
  cursor: pointer;
  text-align: center;
  transition: background-color 0.3s ease;
  margin-bottom: 16px; /* Added consistent bottom margin */
}

.login-btn:hover {
  background-color: #0b87e0;
}

.error-message {
  color: var(--error-color);
  font-size: var(--font-size-small);
  text-align: center;
  margin-bottom: 16px; /* Consistent spacing */
}

/* 
==========================================
ACCOUNT LINKS STYLES
==========================================
*/

.account-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px 0; /* Changed from negative margin to consistent spacing */
}

.no-account {
  color: var(--text-secondary);
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-small);
}

.signup-link {
  color: var(--accent-color);
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-small);
  text-decoration: none;
}

.signup-link:hover {
  text-decoration: underline;
}

.help-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 16px; /* Consistent spacing */
}

.forgot-link,
.trouble-link {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  line-height: 20px;
  text-decoration: none;
  padding: 8px 12px;
  display: inline-block;
  transition: color 0.3s ease;
}

.forgot-link:hover,
.trouble-link:hover {
  color: var(--accent-color);
}

/* 
==========================================
SOCIAL ICONS STYLES
==========================================
*/

.social-icons {
  display: flex;
  gap: 16px;
  margin-top: 0;
}

.social-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.light-theme .social-icon {
  background: rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--text-primary-light);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.social-icon:hover {
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(15px);
}

.light-theme .social-icon:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.social-icon i {
  font-size: 18px;
}

/* Platform-specific hover styles */
.social-icon[aria-label*="Telegram"]:hover {
  background-color: #1c86c9 !important; 
  color: #ffffff !important;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.social-icon[aria-label*="Instagram"]:hover {
  background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%) !important; 
  color: #ffffff !important;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.social-icon[aria-label*="Discord"]:hover {
  background-color: #5865F2 !important; 
  color: #ffffff !important;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.social-icon[aria-label*="Twitter"]:hover {
  background-color: #000000 !important; 
  color: #ffffff !important;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-bottom-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.social-icons-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 32px 0;
}

/* 
==========================================
RESPONSIVE STYLES
==========================================
*/

@media screen and (max-width: 768px) {
  .container {
      padding: 0 24px;
  }

  .login-container {
      max-width: 100%;
      width: 100%;
  }

  .main-content {
      padding-top: 32px;
      padding-bottom: 0;
      min-height: calc(100vh - 72px);
  }

  .social-icons-wrapper {
      padding: 24px 0 32px 0;
  }

  /* Enhanced touch targets for mobile */
  .login-form input {
        height: 48px;
        font-size: 15px;
        padding: 14px 16px;
  }

  .login-btn {
        height: 48px;
        font-size: 15px;
        padding: 14px 16px;
        margin-top: 0;
  }

  .login-bottom-container {
        margin-top: 10px;
        gap: 5px;
  }

  /* Social icons touch optimization */
  .social-icon {
        width: 44px;
        height: 44px;
        font-size: 18px;
  }

  .social-icons {
        gap: 20px;
  }

  /* Better form spacing */
  .login-form {
        gap: 20px;
  }

  .form-group {
        gap: 8px;
  }

  /* Help links spacing */
  .help-links {
        margin-bottom: 12px;
  }

  .account-links {
        margin: 0;
        margin-bottom: 12px;
  }
}

@media screen and (max-width: 480px) {
  .container {
      padding: 0 16px;
  }
  
  .login-header h1 {
      font-size: 24px;
  }

  .login-header p {
      font-size: 12px;
  }

  /* Enhanced mobile form spacing */
  .login-form {
        gap: 20px;
        width: 100%;
  }

  .form-group {
        gap: 10px;
  }

  label {
        font-size: 14px;
  }

  .social-icons {
        gap: 16px;
        margin-top: 0;
  }

  /* Better mobile container spacing */
  .login-container {
        gap: 24px;
  }

  .login-header {
        margin-bottom: 14px;
        margin-top: 30px;
  }
}

/* Landscape mobile orientation */
@media screen and (max-height: 600px) and (orientation: landscape) {
  .main-content {
      padding-top: 16px;
      min-height: auto;
  }

  .login-container {
      max-height: calc(100vh - 32px);
      overflow-y: auto;
  }
}
