@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --bg-dark: #16181c;
  --bg-darker: #131518;
  --bg-input: #1e2025;
  --border-color: #2b2f36;
  --text-main: #ffffff;
  --text-muted: #8b929e;
  --primary-color: #FF3333;
  --primary-hover: #E60000;
  --secondary-bg: #1e2025;
  --secondary-hover: #262930;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-darker);
  color: var(--text-main);
  min-height: 100vh;
  overflow: hidden;
}

/* DESKTOP LAYOUT */
.login-layout { display: flex; min-height: 100vh; width: 100%; }
.login-image-section { flex: 1; position: relative; overflow: hidden; display: none; }
@media (min-width: 900px) { .login-image-section { display: block; } .login-form-section { width: 480px; } }

.login-bg { position: absolute; top: -5%; left: -5%; width: 110%; height: 110%; background-size: cover; background-position: center; background-repeat: no-repeat; }
.login-image-overlay { position: absolute; inset: 0; background: linear-gradient(to right, rgba(0,0,0,0.2) 0%, var(--bg-dark) 100%); z-index: 1; }

.login-form-section {
  width: 100%; max-width: 500px; background-color: var(--bg-dark);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  position: relative; z-index: 2; padding: 2rem; box-shadow: -10px 0 30px rgba(0,0,0,0.5);
}
.login-form-container { width: 100%; max-width: 360px; }

/* Logo */
.logo-wrapper { text-align: center; margin-bottom: 2.5rem; }
.logo-text { font-size: 2.5rem; font-weight: 800; text-transform: uppercase; letter-spacing: -1px; color: var(--text-main); }
.logo-text span { color: var(--primary-color); }

/* Form */
.login-form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-group label { font-size: 0.85rem; color: var(--text-main); font-weight: 400; }

.input-group {
  display: flex; align-items: center;
  background-color: var(--bg-input); border: 1px solid var(--border-color);
  border-radius: 8px; padding: 0 1rem; height: 48px; transition: all 0.2s ease;
}
.input-group:focus-within { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(255,51,51,0.12); }
.input-group i { color: var(--text-muted); font-size: 1.2rem; margin-right: 0.75rem; }
.input-group input { flex: 1; background: transparent; border: none; color: var(--text-main); font-size: 0.95rem; font-family: var(--font-family); outline: none; width: 100%; }
.input-group input::placeholder { color: var(--text-muted); }

.toggle-password { background: transparent; border: none; cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; }
.toggle-password i { margin-right: 0; margin-left: 0.75rem; transition: color 0.2s; cursor: pointer; }
.toggle-password:hover i { color: var(--text-main); }

.form-options { display: flex; align-items: center; margin-top: 0.2rem; margin-bottom: 0.5rem; }
.switch-container { display: flex; align-items: center; gap: 0.75rem; cursor: pointer; }
.switch-container input { display: none; }
.switch-slider { position: relative; width: 36px; height: 20px; background-color: var(--bg-input); border: 1px solid var(--border-color); border-radius: 20px; transition: 0.3s; }
.switch-slider::before { content: ""; position: absolute; height: 14px; width: 14px; border-radius: 50%; left: 2px; bottom: 2px; background-color: var(--text-muted); transition: 0.3s; }
.switch-container input:checked + .switch-slider { background-color: rgba(255,51,51,0.2); border-color: var(--primary-color); }
.switch-container input:checked + .switch-slider::before { transform: translateX(16px); background-color: var(--primary-color); }
.switch-label { font-size: 0.85rem; color: var(--text-muted); }

.btn { display: flex; align-items: center; justify-content: center; gap: 0.5rem; height: 50px; border-radius: 8px; font-weight: 600; font-size: 0.9rem; letter-spacing: 0.5px; cursor: pointer; border: none; transition: all 0.2s ease; text-decoration: none; font-family: var(--font-family); }
.btn-primary { background-color: var(--primary-color); color: #fff; margin-top: 0.5rem; }
.btn-primary:hover { background-color: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(255,51,51,0.35); }
.btn-secondary { background-color: var(--secondary-bg); border: 1px solid var(--border-color); color: var(--text-main); }
.btn-secondary:hover { background-color: var(--secondary-hover); }

.forgot-wrapper { text-align: center; margin-top: 1rem; }
.forgot-password { color: var(--text-muted); font-size: 0.85rem; text-decoration: none; transition: color 0.2s; }
.forgot-password:hover { color: var(--primary-color); text-decoration: underline; }

.footer-logo { position: absolute; bottom: 2rem; opacity: 0.5; transition: opacity 0.3s ease; }
.footer-logo:hover { opacity: 1; }
.footer-logo img { height: 16px; }

/* Desktop: hide hero */
.mobile-cakto-hero { display: none; }
.guarantee-section, .site-footer { display: block; }

/* ============================================================
   MOBILE PREMIUM REDESIGN — Bottom Sheet Style
   ============================================================ */
@media (max-width: 899px) {
  body { overflow-x: hidden; overflow-y: auto; background: #0a0b0d; }

  /* Background image fills entire screen */
  .login-layout {
    background-image: url('https://i.imgur.com/vcPucQL.jpeg');
    background-size: cover;
    background-position: center top;
    background-attachment: fixed;
    min-height: 100vh;
    flex-direction: column;
    justify-content: flex-end;
  }

  /* Form section floats at the bottom */
  .login-form-section {
    width: 100%; max-width: 100%;
    min-height: auto; background: transparent;
    box-shadow: none; padding: 0;
    justify-content: flex-end;
    align-items: stretch;
  }

  /* Top bar — fixed, shows brand + menu icon */
  .mobile-cakto-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3rem 1.5rem 1.5rem;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 5;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, transparent 100%);
  }

  .cakto-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 0;
  }

  /* Hide bulky marketing content — keep only the header bar */
  .cakto-pill, .cakto-title, .cakto-subtitle, .cakto-btn { display: none; }
  .guarantee-section, .site-footer { display: none; }

  /* Default logo hidden on mobile (avatar shows inside form) */
  .logo-wrapper { display: none; }

  /* --- BOTTOM SHEET FORM --- */
  .login-form-container {
    background: rgba(12, 14, 18, 0.97);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    padding: 1.5rem 1.5rem 3rem;
    border-radius: 24px 24px 0 0;
    border-top: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 -20px 60px rgba(0,0,0,0.9);
    width: 100%;
    max-width: 100%;
    margin-top: 0;
    position: relative;
  }

  /* Drag handle pill */
  .login-form-container::before {
    content: '';
    display: block;
    width: 36px; height: 4px;
    background: rgba(255,255,255,0.12);
    border-radius: 2px;
    margin: 0 auto 1.5rem;
  }

  /* Show avatar/logo inside sheet */
  .logo-wrapper {
    display: flex !important;
    justify-content: center;
    margin-bottom: 1.5rem;
  }

  #login-avatar-preview {
    width: 68px !important;
    height: 68px !important;
    box-shadow: 0 0 0 3px rgba(255,51,51,0.35), 0 0 25px rgba(255,51,51,0.2) !important;
  }

  /* Inputs */
  .input-group {
    height: 54px;
    border-radius: 14px;
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.09);
  }
  .input-group:focus-within {
    background: rgba(255,51,51,0.04);
    border-color: rgba(255,51,51,0.5);
    box-shadow: 0 0 0 3px rgba(255,51,51,0.1);
  }

  /* Labels */
  .form-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 0.8px;
  }

  /* Primary button */
  .btn-primary {
    height: 56px;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    box-shadow: 0 10px 30px rgba(255,51,51,0.45);
    color: #fff;
  }

  /* Secondary button */
  .btn-secondary, #btn-toggle-mode {
    height: 52px !important;
    border-radius: 14px !important;
    background: rgba(255,255,255,0.04) !important;
    border: 1px solid rgba(255,255,255,0.09) !important;
    color: rgba(255,255,255,0.75) !important;
  }

  /* Forgot link */
  .forgot-wrapper { margin-top: 1.25rem; }
  .forgot-password { font-size: 0.82rem; }

  /* Dropdown */
  .mobile-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px); right: 0;
    background: rgba(15,17,21,0.99);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px; padding: 0.4rem 0;
    box-shadow: 0 15px 50px rgba(0,0,0,0.8);
    z-index: 100; min-width: 210px;
    backdrop-filter: blur(20px);
  }
  .mobile-dropdown.active { display: block; animation: dropIn 0.25s cubic-bezier(0.34,1.56,0.64,1) forwards; }
  .mobile-dropdown a { display: flex; align-items: center; gap: 0.8rem; padding: 0.9rem 1.2rem; color: #fff; text-decoration: none; font-size: 0.9rem; font-weight: 600; transition: 0.2s; }
  .mobile-dropdown a i { font-size: 1.1rem; color: var(--primary-color); }
  .mobile-dropdown a:hover { background: rgba(255,51,51,0.08); color: var(--primary-color); }

  @keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  .otp-input { width: 44px !important; height: 54px !important; border-radius: 12px !important; }
}

/* Animation start state */
.anim-item { opacity: 0; visibility: hidden; }