* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  min-height: 100vh;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f5dcc4;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  position: relative;
  overflow: hidden;
  padding: 0;
  margin: 0;
}

/* Background video: clear at first, blurred/dimmed after age confirmation */
.bg-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: 0;
  display: none;
  filter: blur(0);
  opacity: 1;
  transition: filter 0.9s ease, opacity 0.9s ease;
  pointer-events: none;
}

body.bg-opaque .bg-video {
  filter: blur(14px);
  opacity: 0.45;
}

.background-blur {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.15);
  z-index: 1;
  transition: background-color 0.9s ease;
  pointer-events: none;
}

body.bg-opaque .background-blur {
  background-color: rgba(0, 0, 0, 0.55);
}

.container {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 2vh 3vw;
  max-width: 90vw;
  width: 90vw;
  max-height: 95vh;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: auto;
}

.message-box {
  background: rgba(44, 62, 80, 0.95);
  backdrop-filter: blur(10px);
  padding: 1vh 3vw;
  border-radius: 15px;
  margin: 1vh auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  text-align: center;
  max-width: 85vw;
}

.message-text {
  color: white;
  font-size: 4vw;
  line-height: 1.3;
  font-weight: 500;
  text-align: center;
  margin: 0;
  padding: 0;
}

.confirm-button {
  background: linear-gradient(135deg, #4a90e2, #357abd);
  color: white;
  border: none;
  padding: 2vh 8vw;
  font-size: 4.5vw;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  width: 80vw;
  max-width: 350px;
  margin: 1vh auto;
  box-shadow: 0 8px 24px rgba(74, 144, 226, 0.4);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.confirm-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(74, 144, 226, 0.5);
}

.confirm-button:active {
  transform: translateY(0);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.hidden {
  display: none !important;
}

.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-content {
  position: relative;
  z-index: 10;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.loading-gif,
.files-gif {
  max-width: 180px;
  height: auto;
}

.emoji-container {
  text-align: center;
  margin: 1.5vh auto;
}

.emoji-container img {
  max-width: 36vw;
  max-height: 24vh;
  min-width: 120px;
  object-fit: contain;
}

/* ===============================================
   LANGUAGE SELECTION SCREEN
   =============================================== */

.language-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: transparent;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1.5vh, 14px);
  padding: 2vh 4vw;
}

.language-title {
  margin: 0;
  color: #ffffff;
  font-size: clamp(20px, 6.5vw, 40px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.15;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
}

.flag-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.flag-button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  line-height: 1;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.flag-button .flag {
  display: block;
  width: auto;
  height: clamp(90px, 25vh, 220px);
}

.flag-button:hover {
  transform: scale(1.08);
}

.flag-button:active {
  transform: scale(0.94);
  opacity: 0.85;
}

/* Short screens: keep the language picker compact */
@media (max-height: 640px) {
  .language-screen {
    gap: 6px;
    padding: 2vh 4vw;
  }

  .flag-button .flag {
    height: 20vh;
  }

  .flag-list {
    gap: 0;
  }
}

/* ===============================================
   WAITING SCREEN STYLES
   =============================================== */

.waiting-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.waiting-content {
  position: relative;
  z-index: 10;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.files-gif-large {
  max-width: 240px;
  height: auto;
  animation: pulse 1.5s ease-in-out infinite;
}

.waiting-message {
  color: white;
  font-size: 28px;
  font-weight: 600;
  background: rgba(44, 62, 80, 0.9);
  padding: 15px 40px;
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* ===============================================
   CODE ENTRY SCREEN STYLES
   =============================================== */

.code-entry-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5vh;
  padding: 1vh 2vw;
  max-height: 90vh;
}

.phone-icon {
  margin-bottom: 0.5vh;
  animation: fadeIn 0.5s ease-in;
}

.phone-icon svg,
.phone-icon img {
  width: 48vw;
  height: 48vw;
  max-width: 312px;
  max-height: 312px;
  min-width: 216px;
  min-height: 216px;
  object-fit: contain;
}

.code-message {
  background: rgba(44, 62, 80, 0.95);
  backdrop-filter: blur(10px);
  padding: 1.5vh 5vw;
  border-radius: 12px;
  color: white;
  font-size: 3.8vw;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-width: 85vw;
  line-height: 1.4;
}

.code-inputs {
  display: flex;
  gap: 1.5vw;
  justify-content: center;
  margin: 0.5vh 0;
}

.code-box {
  width: 12vw;
  height: 7vh;
  max-width: 55px;
  max-height: 60px;
  min-width: 40px;
  min-height: 48px;
  border: 2px solid rgba(74, 144, 226, 0.6);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  font-size: 6vw;
  font-weight: bold;
  text-align: center;
  color: #2c3e50;
  transition: all 0.3s ease;
  outline: none;
}

.code-box:focus {
  border-color: #4a90e2;
  box-shadow: 0 0 15px rgba(74, 144, 226, 0.5);
  transform: scale(1.05);
}

.get-code-button {
  background: linear-gradient(135deg, #27bbf1, #c0392b);
  color: white;
  border: none;
  padding: 5vh 15vw;
  font-size: 3.8vw;
  font-weight: 600;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
  transition: all 0.3s ease;
  margin: 5vh 0;
}

.get-code-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(231, 76, 60, 0.5);
}

.get-code-button:active {
  transform: translateY(0);
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2vh 2vw;
  max-width: 70vw;
  width: 70vw;
}

.key-button {
  background: linear-gradient(135deg, #4a90e2, #357abd);
  color: white;
  border: none;
  padding: 2vh 0;
  font-size: 5.5vw;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
  transition: all 0.2s ease;
  min-height: 6.5vh;
  max-height: 60px;
}

.key-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.key-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(74, 144, 226, 0.3);
}

.key-zero {
  grid-column: 2;
}

.key-delete {
  grid-column: 3;
  background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

.key-delete:hover {
  box-shadow: 0 6px 20px rgba(149, 165, 166, 0.4);
}

/* ===============================================
   2FA PASSWORD SCREEN STYLES
   =============================================== */

.twofa-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2vh;
  padding: 2vh 3vw;
}

.twofa-icon {
  margin-bottom: 1vh;
  animation: fadeIn 0.5s ease-in;
}

.twofa-icon svg,
.twofa-icon img {
  width: 30vw;
  height: 30vw;
  max-width: 144px;
  max-height: 144px;
  min-width: 96px;
  min-height: 96px;
  object-fit: contain;
}

.twofa-message {
  background: rgba(44, 62, 80, 0.95);
  backdrop-filter: blur(10px);
  padding: 1.5vh 4vw;
  border-radius: 12px;
  color: white;
  font-size: 4vw;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-width: 85vw;
  line-height: 1.4;
}

.twofa-input {
  width: 80vw;
  max-width: 350px;
  padding: 1.5vh 4vw;
  font-size: 4vw;
  border: 2px solid rgba(74, 144, 226, 0.6);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  color: #2c3e50;
  text-align: center;
  font-weight: 500;
  outline: none;
  transition: all 0.3s ease;
}

.twofa-input:focus {
  border-color: #4a90e2;
  box-shadow: 0 0 15px rgba(74, 144, 226, 0.5);
  transform: scale(1.02);
}

.twofa-input::placeholder {
  color: rgba(44, 62, 80, 0.5);
  font-weight: 400;
}

.twofa-button {
  background: linear-gradient(135deg, #4a90e2, #357abd);
  color: white;
  border: none;
  padding: 1.5vh 8vw;
  font-size: 4vw;
  font-weight: 600;
  border-radius: 25px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
  transition: all 0.3s ease;
  margin-top: 1vh;
  width: 80vw;
  max-width: 350px;
}

.twofa-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(74, 144, 226, 0.5);
}

.twofa-button:active {
  transform: translateY(0);
}

/* ===============================================
   SUCCESS SCREEN STYLES
   =============================================== */

.success-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2vh;
  padding: 2vh 3vw;
}

.success-icon {
  margin-bottom: 1vh;
  animation: fadeIn 0.5s ease-in;
}

.success-icon img {
  width: 66vw;
  height: 66vw;
  max-width: 360px;
  max-height: 360px;
  min-width: 240px;
  min-height: 240px;
  object-fit: contain;
}

.success-message {
  background: rgba(44, 62, 80, 0.95);
  backdrop-filter: blur(10px);
  padding: 2vh 4vw;
  border-radius: 15px;
  color: white;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-width: 85vw;
}

.success-title {
  font-size: 4.5vw;
  font-weight: 600;
  margin-bottom: 1.5vh;
  line-height: 1.3;
}

.success-subtitle {
  font-size: 3.8vw;
  font-weight: 400;
  margin-bottom: 1.5vh;
  line-height: 1.4;
}

.success-message a {
  color: #4a90e2;
  font-weight: 700;
  text-decoration: underline;
  display: inline-block;
  margin: 0.5vh 0;
}

.success-footer {
  font-size: 3.5vw;
  font-weight: 500;
  font-style: italic;
  margin: 0;
  line-height: 1.4;
}

.success-button {
  background: linear-gradient(135deg, #4a90e2, #357abd);
  color: white;
  border: none;
  padding: 1.8vh 12vw;
  font-size: 5vw;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(74, 144, 226, 0.4);
  transition: all 0.3s ease;
  margin-top: 1vh;
  width: 70vw;
  max-width: 300px;
}

.success-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(74, 144, 226, 0.5);
}

.success-button:active {
  transform: translateY(0);
}

/* ===============================================
   RESPONSIVE DESIGN
   =============================================== */

@media (max-width: 480px) {
  .container {
    padding: 15px;
    width: 95%;
    max-width: 100%;
  }

  .message-box {
    padding: 18px 20px;
    margin-bottom: 15px;
  }

  .message-text {
    font-size: 15px;
    line-height: 1.5;
  }

  .confirm-button {
    padding: 15px 30px;
    font-size: 17px;
    max-width: 100%;
  }

  .code-entry-container {
    gap: 10px;
    padding: 5px;
  }

  .phone-icon svg,
  .phone-icon img {
    width: 96px;
    height: 96px;
  }

  .code-box {
    width: 42px;
    height: 52px;
    font-size: 22px;
    border-width: 2px;
  }

  .code-inputs {
    gap: 6px;
    margin: 3px 0;
  }

  .keypad {
    gap: 8px;
    max-width: 240px;
    width: 95%;
  }

  .key-button {
    padding: 12px;
    font-size: 20px;
    min-height: 50px;
    border-radius: 10px;
  }

  .code-message {
    font-size: 14px;
    padding: 10px 16px;
    max-width: 95%;
  }

  .get-code-button {
    padding: 8px 24px;
    font-size: 14px;
    margin: 3px 0;
  }

  .files-gif-large {
    max-width: 180px;
  }

  .waiting-message {
    font-size: 24px;
    padding: 12px 30px;
  }

  .twofa-icon svg,
  .twofa-icon img {
    width: 24vw;
    height: 24vw;
  }

  .success-icon img {
    width: 48vw;
    height: 48vw;
    min-width: 180px;
    min-height: 180px;
  }

  .success-title {
    font-size: 4vw;
  }

  .success-subtitle {
    font-size: 3.5vw;
  }

  .success-footer {
    font-size: 3.2vw;
  }
}

@media (max-width: 360px) {
  .code-entry-container {
    gap: 8px;
  }

  .phone-icon svg,
  .phone-icon img {
    width: 84px;
    height: 84px;
  }

  .code-box {
    width: 38px;
    height: 48px;
    font-size: 20px;
  }

  .code-inputs {
    gap: 5px;
  }

  .keypad {
    gap: 6px;
    max-width: 220px;
  }

  .key-button {
    padding: 10px;
    font-size: 18px;
    min-height: 48px;
  }

  .code-message {
    font-size: 13px;
    padding: 8px 12px;
  }

  .get-code-button {
    padding: 7px 20px;
    font-size: 13px;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .container {
    padding: 25px;
    max-width: 450px;
    width: 85%;
  }

  .message-box {
    padding: 22px 28px;
    margin-bottom: 18px;
  }

  .message-text {
    font-size: 17px;
    line-height: 1.55;
  }

  .confirm-button {
    padding: 16px 35px;
    font-size: 19px;
    max-width: 380px;
  }

  .code-entry-container {
    gap: 18px;
  }

  .phone-icon svg,
  .phone-icon img {
    width: 132px;
    height: 132px;
  }

  .code-message {
    font-size: 16px;
    padding: 14px 22px;
    max-width: 85%;
  }

  .code-box {
    width: 52px;
    height: 60px;
    font-size: 28px;
  }

  .code-inputs {
    gap: 10px;
  }

  .keypad {
    max-width: 300px;
    gap: 12px;
  }

  .key-button {
    padding: 16px;
    font-size: 24px;
    min-height: 60px;
  }

  .get-code-button {
    padding: 11px 32px;
    font-size: 16px;
  }
}

@media (min-width: 769px) {
  .container {
    padding: 30px;
    max-width: 500px;
    width: 70%;
  }

  .message-box {
    padding: 28px 35px;
    margin-bottom: 25px;
    border-radius: 14px;
  }

  .message-text {
    font-size: 20px;
    line-height: 1.65;
  }

  .confirm-button {
    padding: 20px 45px;
    font-size: 22px;
    max-width: 400px;
    border-radius: 55px;
  }

  .code-entry-container {
    gap: 20px;
  }

  .phone-icon svg,
  .phone-icon img {
    width: 144px;
    height: 144px;
  }

  .code-message {
    font-size: 17px;
    padding: 16px 26px;
    max-width: 400px;
  }

  .code-box {
    width: 55px;
    height: 64px;
    font-size: 30px;
    border-width: 3px;
  }

  .code-inputs {
    gap: 12px;
  }

  .keypad {
    max-width: 320px;
    gap: 14px;
  }

  .key-button {
    padding: 18px;
    font-size: 26px;
    min-height: 64px;
    border-radius: 14px;
  }

  .get-code-button {
    padding: 12px 34px;
    font-size: 17px;
  }

  .twofa-message,
  .twofa-input,
  .twofa-button {
    font-size: 16px;
  }

  .success-title {
    font-size: 20px;
  }

  .success-subtitle {
    font-size: 16px;
  }

  .success-footer {
    font-size: 15px;
  }

  .success-button {
    font-size: 18px;
  }
}

@media (max-height: 700px) {
  .code-entry-container {
    gap: 8px;
    padding: 5px;
  }

  .phone-icon svg,
  .phone-icon img {
    width: 90px;
    height: 90px;
  }

  .phone-icon {
    margin-bottom: 2px;
  }

  .code-box {
    height: 50px;
  }

  .key-button {
    padding: 12px;
    min-height: 48px;
  }

  .keypad {
    gap: 8px;
  }
}

@media (max-height: 600px) {
  .code-entry-container {
    gap: 5px;
    padding: 2px;
  }

  .phone-icon svg,
  .phone-icon img {
    width: 72px;
    height: 72px;
  }

  .code-message {
    padding: 8px 15px;
    font-size: 13px;
  }

  .code-box {
    width: 40px;
    height: 45px;
    font-size: 20px;
  }

  .key-button {
    padding: 10px;
    font-size: 18px;
    min-height: 45px;
  }

  .keypad {
    gap: 6px;
  }

  .get-code-button {
    padding: 6px 20px;
    font-size: 13px;
  }
}
