
:root{
  /* JiFish Brand Colors */
  --ocean-deep: #0a4d68;
  --ocean-light: #1e88e5;
  --aqua: #00bcd4;
  --coral: #ff6b6b;
  --coral-light: #ffa07a;
  --sunshine: #ffd93d;
  
  /* Ocean Gradients */
  --bg1: #e3f2fd;
  --bg2: #b3e5fc;
  --bg3: #80deea;

  /* UI Elements */
  --card: rgba(255, 255, 255, 0.98);
  --glass: rgba(255, 255, 255, 0.85);
  --stroke: rgba(10, 77, 104, 0.15);
  --txt: rgba(15, 23, 42, 0.92);
  --muted: rgba(15, 23, 42, 0.62);

  /* Status */
  --success: #4caf50;
  --error: #f44336;
  --warning: #ff9800;

  /* Shadows */
  --shadow-sm: 0 4px 16px rgba(10, 77, 104, 0.1);
  --shadow-md: 0 8px 32px rgba(10, 77, 104, 0.15);
  --shadow-lg: 0 16px 48px rgba(10, 77, 104, 0.2);
  
  /* Navigation */
  --nav-height: 70px;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--txt);
  background: linear-gradient(180deg, var(--bg1) 0%, var(--bg2) 50%, var(--bg3) 100%);
  position: relative;
}

/* ===============================
   SPLASH SCREEN - Swimming Fish
   =============================== */
.splash {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  
  background: linear-gradient(135deg, 
    var(--ocean-deep) 0%, 
    var(--ocean-light) 40%,
    var(--aqua) 70%,
    var(--coral-light) 100%
  );
  
  animation: splashExit 0.8s ease-in-out 2.5s forwards;
  overflow: hidden;
}

/* Ocean waves in splash */
.splash::before {
  content: "";
  position: absolute;
  bottom: -10%;
  left: 0;
  width: 200%;
  height: 200px;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 1200 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0v46.29c47.79 22.2 103.59 32.17 158 28 70.36-5.37 136.33-33.31 206.8-37.5 73.84-4.36 147.54 16.88 218.2 35.26 69.27 18 138.3 24.88 209.4 13.08 36.15-6 69.85-17.84 104.45-29.34C989.49 25 1113-14.29 1200 52.47V0z' fill='%23ffffff' fill-opacity='0.1'/%3E%3C/svg%3E") repeat-x;
  animation: waveMove 20s linear infinite;
}

@keyframes waveMove {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes splashExit {
  0% { 
    clip-path: circle(100%);
    opacity: 1;
  }
  100% { 
    clip-path: circle(0%);
    opacity: 0;
    pointer-events: none;
  }
}

.splash-content {
  text-align: center;
  position: relative;
  z-index: 2;
  animation: splashContentFade 0.6s ease-out 2.2s forwards;
}

@keyframes splashContentFade {
  to { opacity: 0; transform: scale(0.9); }
}

/* JiFish Logo in splash */
.splash-logo {
  margin-bottom: 30px;
  animation: logoFloat 2s ease-in-out 0.3s backwards infinite;
  filter: drop-shadow(0 10px 40px rgba(255, 255, 255, 0.3));
}

.splash-logo-text {
  font-size: 72px;
  font-weight: 900;
  color: white;
  text-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.3),
    0 0 40px rgba(255, 255, 255, 0.5);
  letter-spacing: 2px;
}

.splash-logo-sub {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.95);
  margin-top: 8px;
  font-weight: 600;
  letter-spacing: 1px;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

/* Swimming Fish Animation */
.splash-fish {
  font-size: 80px;
  animation: 
    fishSwim 2.5s cubic-bezier(0.4, 0.0, 0.2, 1) 0.8s backwards,
    fishFloat 3s ease-in-out 3s infinite;
  filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.35));
}

@keyframes fishSwim {
  0% { 
    transform: translateX(-200vw) translateY(100px) scaleX(1);
    opacity: 0;
  }
  60% {
    transform: translateX(20px) translateY(-20px) scaleX(1);
    opacity: 1;
  }
  100% { 
    transform: translateX(0) translateY(0) scaleX(1);
    opacity: 1;
  }
}

@keyframes fishFloat {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}

.splash-text {
  margin-top: 20px;
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.98);
  letter-spacing: 3px;
  animation: textWave 2s ease-in-out 1.5s infinite;
}

@keyframes textWave {
  0%, 100% { opacity: 1; transform: translateY(0); }
  50% { opacity: 0.6; transform: translateY(-4px); }
}

/* ===============================
   MAIN CONTENT
   =============================== */
.main-content {
  position: relative;
  min-height: 100vh;
  overflow-y: auto;
  opacity: 0;
  animation: mainFadeIn 1s ease-out 3s forwards;
}

@keyframes mainFadeIn {
  to { opacity: 1; }
}

/* ===============================
   BACKGROUND - Ocean Environment
   =============================== */
.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Bubbles */
.bubble {
  position: absolute;
  bottom: -100px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.2));
  border-radius: 50%;
  opacity: 0.6;
  animation: bubbleRise 8s ease-in infinite;
}

.bubble:nth-child(1) {
  left: 10%;
  width: 40px;
  height: 40px;
  animation-delay: 0s;
  animation-duration: 7s;
}

.bubble:nth-child(2) {
  left: 30%;
  width: 25px;
  height: 25px;
  animation-delay: 2s;
  animation-duration: 9s;
}

.bubble:nth-child(3) {
  left: 50%;
  width: 35px;
  height: 35px;
  animation-delay: 4s;
  animation-duration: 8s;
}

.bubble:nth-child(4) {
  left: 70%;
  width: 20px;
  height: 20px;
  animation-delay: 1s;
  animation-duration: 10s;
}

.bubble:nth-child(5) {
  left: 85%;
  width: 30px;
  height: 30px;
  animation-delay: 3s;
  animation-duration: 7.5s;
}

@keyframes bubbleRise {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.6;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-100vh) scale(0.5);
    opacity: 0;
  }
}

/* Swimming Fish Background */
.fish-bg {
  position: absolute;
  font-size: 24px;
  opacity: 0.15;
  animation: fishSwimBg 25s linear infinite;
}

.fish-bg:nth-child(6) {
  top: 15%;
  animation-duration: 20s;
}

.fish-bg:nth-child(7) {
  top: 45%;
  animation-duration: 30s;
  animation-delay: -5s;
}

.fish-bg:nth-child(8) {
  top: 75%;
  animation-duration: 25s;
  animation-delay: -10s;
}

@keyframes fishSwimBg {
  0% {
    left: -100px;
    transform: scaleX(1);
  }
  49.9% {
    left: calc(100% + 100px);
    transform: scaleX(1);
  }
  50% {
    left: calc(100% + 100px);
    transform: scaleX(-1);
  }
  99.9% {
    left: -100px;
    transform: scaleX(-1);
  }
  100% {
    left: -100px;
    transform: scaleX(1);
  }
}

/* Color blobs - Ocean themed */
.blob {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.3;
  animation: blobFloat 15s ease-in-out infinite;
}

.blob.b1 { 
  left: -150px; 
  top: -150px; 
  background: radial-gradient(circle, var(--ocean-light), transparent);
}

.blob.b2 { 
  right: -180px; 
  top: 100px;  
  background: radial-gradient(circle, var(--coral), transparent);
  animation-delay: -5s; 
}

.blob.b3 { 
  left: 25%; 
  bottom: -200px; 
  background: radial-gradient(circle, var(--aqua), transparent);
  animation-delay: -10s; 
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -25px) scale(1.1); }
  66% { transform: translate(-25px, 20px) scale(0.9); }
}

/* ===============================
   LAYOUT & WRAPPER
   =============================== */
.wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  justify-items: center;
  align-content: center;
  padding: 24px 16px;
}

@media (max-width: 520px) {
  .wrap {
    align-content: center;
    padding-top: 20px;
    padding-bottom: 40px;
  }
}

/* ===============================
   CARD - Glass Morphism
   =============================== */
.card {
  width: 100%;
  max-width: 480px;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(180%);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 28px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: visible;
}

/* Shimmer effect on card border */
.card::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 28px;
  padding: 2px;
  background: linear-gradient(
    135deg,
    var(--ocean-light),
    var(--aqua),
    var(--coral),
    var(--sunshine)
  );
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.4;
  z-index: -1;
  animation: borderShimmer 4s ease-in-out infinite;
}

@keyframes borderShimmer {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}

@media (max-width: 520px) {
  .card {
    max-width: 440px;
    border-radius: 24px;
    padding: 24px;
  }
}

/* Card animation */
.pop-in {
  animation: popIn 0.6s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

@keyframes popIn {
  from { transform: translateY(30px) scale(0.94); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* ===============================
   HEADER - Brand
   =============================== */
.brand {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
  position: relative;
}

.logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--ocean-light), var(--aqua));
  border: 3px solid rgba(255, 255, 255, 0.8);
  box-shadow: 
    0 4px 16px rgba(10, 77, 104, 0.3),
    0 0 40px rgba(0, 188, 212, 0.4);
  position: relative;
  animation: logoSwim 3s ease-in-out infinite;
}

@keyframes logoSwim {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  25% { transform: translateX(-4px) rotate(-3deg); }
  50% { transform: translateX(0) rotate(0deg); }
  75% { transform: translateX(4px) rotate(3deg); }
}

/* Ripple effect */
.logo::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--aqua), transparent);
  opacity: 0;
  animation: ripple 2.5s ease-out infinite;
}

@keyframes ripple {
  0% { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1.4); opacity: 0; }
}

h1 {
  font-size: 24px;
  font-weight: 900;
  margin: 0 0 4px;
  background: linear-gradient(135deg, var(--ocean-deep), var(--ocean-light), var(--aqua));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.5px;
}

.brand p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

/* Wave decoration */
.brand::after {
  content: "";
  position: absolute;
  bottom: -16px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--ocean-light) 20%,
    var(--aqua) 50%,
    var(--coral) 80%,
    transparent
  );
  border-radius: 999px;
  opacity: 0.6;
}

/* ===============================
   FORM ELEMENTS
   =============================== */
.form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

@media (max-width: 520px) {
  .form { gap: 14px; }
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--txt);
}

input, select, textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 2px solid rgba(10, 77, 104, 0.15);
  background: rgba(255, 255, 255, 0.95);
  color: var(--txt);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input::placeholder, select::placeholder, textarea::placeholder {
  color: rgba(15, 23, 42, 0.4);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--ocean-light);
  background: white;
  box-shadow: 
    0 0 0 4px rgba(30, 136, 229, 0.15),
    0 4px 20px rgba(10, 77, 104, 0.2);
  transform: translateY(-2px);
}

/* Grid layout */
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 520px) {
  .grid2 { 
    grid-template-columns: 1fr; 
    gap: 12px;
  }
}

/* Password field */
.pw {
  display: flex;
  gap: 10px;
  align-items: center;
}

.ghost {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  border: 2px solid rgba(10, 77, 104, 0.15);
  background: rgba(255, 255, 255, 0.95);
  cursor: pointer;
  font-size: 20px;
  transition: all 0.25s ease;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.ghost:hover {
  background: rgba(30, 136, 229, 0.1);
  border-color: var(--ocean-light);
  transform: scale(1.08);
}

.ghost:active {
  transform: scale(0.95);
}

/* ===============================
   CUSTOM DROPDOWN
   =============================== */
.dropdown {
  position: relative;
  width: 100%;
}

.dd-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 16px;
  border: 2px solid rgba(10, 77, 104, 0.15);
  background: rgba(255, 255, 255, 0.95);
  color: var(--txt);
  cursor: pointer;
  outline: none;
  font-size: 15px;
  text-align: left;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dd-btn:focus, .dd-btn:hover {
  border-color: var(--ocean-light);
  background: white;
  box-shadow: 
    0 0 0 4px rgba(30, 136, 229, 0.15),
    0 4px 20px rgba(10, 77, 104, 0.2);
}

.dd-value {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 10px;
  color: var(--txt);
}

.dd-value:empty::before {
  content: "-- Chọn --";
  color: rgba(15, 23, 42, 0.4);
}

.dd-caret {
  flex: 0 0 auto;
  opacity: 0.7;
  transition: transform 0.25s ease;
  font-size: 16px;
  color: var(--muted);
}

.dropdown.open .dd-caret {
  transform: rotate(180deg);
}

.dd-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(10, 77, 104, 0.15);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  max-height: 250px;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 100;
}

.dropdown.open .dd-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dd-item {
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--txt);
  font-size: 14px;
  transition: background 0.2s ease;
}

.dd-item:hover {
  background: rgba(30, 136, 229, 0.1);
}

.dd-item.active {
  background: rgba(30, 136, 229, 0.15);
  font-weight: 700;
  color: var(--ocean-deep);
}

/* ===============================
   CHECKBOX
   =============================== */
.check {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 2px solid rgba(10, 77, 104, 0.15);
  background: rgba(255, 255, 255, 0.95);
  font-size: 13px;
  font-weight: 600;
  color: var(--txt);
  cursor: pointer;
  transition: all 0.25s ease;
}

.check:hover {
  border-color: rgba(10, 77, 104, 0.25);
  background: rgba(30, 136, 229, 0.05);
}

.check input[type="checkbox"] {
  width: auto;
  height: 20px;
  cursor: pointer;
  accent-color: var(--ocean-light);
}

.check span {
  cursor: pointer;
  user-select: none;
}

/* ===============================
   BUTTON - Ocean Wave
   =============================== */
.btn {
  position: relative;
  padding: 16px;
  margin-top: 8px;
  border-radius: 18px;
  border: none;
  background: linear-gradient(135deg, var(--ocean-deep) 0%, var(--ocean-light) 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 
    0 4px 16px rgba(10, 77, 104, 0.3),
    0 10px 35px rgba(30, 136, 229, 0.25);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

/* Wave overlay effect */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--aqua) 0%, var(--coral-light) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 6px 20px rgba(10, 77, 104, 0.35),
    0 14px 45px rgba(30, 136, 229, 0.3);
}

.btn:hover::before {
  opacity: 1;
}

.btn:active {
  transform: translateY(0);
}

.btnText {
  position: relative;
  z-index: 1;
}

.btn.loading {
  pointer-events: none;
  opacity: 0.85;
}

.btn.loading .btnText {
  opacity: 0.7;
}

.spinner {
  position: absolute;
  right: 18px;
  top: 50%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  transform: translateY(-50%);
  opacity: 0;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

.btn.loading .spinner { 
  opacity: 1; 
}

/* ===============================
   MESSAGE
   =============================== */
.msg {
  min-height: 22px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.msg:not(:empty) {
  opacity: 1;
  transform: translateY(0);
}

.msg.good { 
  color: var(--success);
  background: rgba(76, 175, 80, 0.12);
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.msg.bad { 
  color: var(--error);
  background: rgba(244, 67, 54, 0.12);
  border: 1px solid rgba(244, 67, 54, 0.3);
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-12px); }
  75% { transform: translateX(12px); }
}

/* ===============================
   LEARNING BADGE
   =============================== */
.learning-badge {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, 
    rgba(255, 211, 61, 0.1), 
    rgba(255, 183, 77, 0.1)
  );
  border: 2px solid rgba(255, 211, 61, 0.3);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* ===============================
   LINKS
   =============================== */
.links {
  margin-top: 20px;
  font-size: 13px;
  text-align: center;
}

.links a {
  color: var(--ocean-light);
  font-weight: 700;
  text-decoration: none;
  position: relative;
  display: inline-block;
  padding-bottom: 2px;
}

.links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--ocean-light), var(--aqua));
  transition: width 0.3s ease;
}

.links a:hover::after {
  width: 100%;
}

.links a:hover {
  color: var(--ocean-deep);
}

/* ===============================
   BRAND LOGO
   =============================== */
.card-brand-logo {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 100px;
  height: 100px;
  object-fit: contain;
  opacity: 0.15;
  pointer-events: none;
  filter: drop-shadow(0 8px 20px rgba(10, 77, 104, 0.2));
  animation: logoFloat 4s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(5deg); }
}

/* ===============================
   UTILITIES
   =============================== */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }