.header {
    position: relative;
}

body {
    margin: 8px;
    min-height: 100vh;
    background: radial-gradient(ellipse at bottom,
            #0b1d2a 0%,
            #05070d 70%);
    overflow: hidden;
    color: white;
    padding: 30px;
    font-family: Arial, sans-serif;
}

.clock {
  display: flex;
  margin-left: 0px;
  transform: translateY(-30px);
  align-items: center;
  font-family: "Courier New", monospace;
  font-size: 20px;
  font-weight: bold;
  color: #0ff;
}

.sep {
  margin: 0 px;
}

/* 1 bộ đếm */
.digit {
  position: relative;
  width: 1ch;
  height: 1.3em;
  overflow: hidden;
}

/* số bên trong */
.digit span {
  position: absolute;
  left: 0;
  width: 100%;
  text-align: center;
  transition: transform 0.35s ease;
}

/* số đang hiển thị */
.current {
  transform: translateY(0);
}

/* số kế tiếp nằm dưới */
.next {
  transform: translateY(100%);
}

/* khi trượt */
.digit.slide .current {
  transform: translateY(-100%);
}

.navbar {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 10px;
}
.navbar * {
    user-select: none !important;
    -webkit-user-select: none !important;
    -ms-user-select: none !important;
}

.hover-area {
    position: relative;
    display: inline-block;
}

.account i {
    flex-shrink: 0;
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

.account {
    width: 46px;
    height: 46px;
    border: 2px solid #fff;
    border-radius: 10px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #fff;
    cursor: pointer;
    background: transparent;
    font-size: 22px;

    overflow: hidden;
    position: relative;

    transition: 
      width 0.75s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* chữ */
.account .dangnhap {
    position: absolute;
    left: 44px;
    top: 50%;
    transform: translateY(-50%) translateX(-6px);

    color: #fff;
    font-size: 16px;
    white-space: nowrap;

    opacity: 0;
    transition: 0.3s ease;
}
.account:active .dangnhap {
    color: black;
}


.account:hover {
    width: 137px;
}

.account:hover .dangnhap {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}


/* hover ra – delay chữ biến mất */
.account:not(:hover) .dangnhap {
    transition-delay: 0.5s;
}

.account:active {
    transform: scale(0.94, 0.94);  
    background: #ffffff;             
    color: #000000;                  
}



.volume {
    width: 46px;
    height: 46px;
    border: 2px solid #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    background: transparent;
    font-size: 18px;
    transition: all 0.3s;
}

.volume:hover {
    background: #fff;
    color: #000;
}

.volume i {
    font-size: 22px;
}

.volume:active {
    transform: scale(0.94,0,94);
}

.menu-btn {
    width: 43px;
    height: 43px;
    border: 2px solid #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: default;
}

.menu-btn::before {
    content: "☰";
    font-size: 26px;
    line-height: 1;
    display: block;
    cursor: pointer;
}

/* Menu */
#menu {
    list-style: none;
    width: 190px;
    margin-top: 6px;
    background: #f2ff00;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    position: absolute; /* nằm trên nội dung */
    top: 45px;
    right: 0;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 999;
    padding: 0;
}

/* Hiển thị menu */
.menu-btn:hover + #menu,
#menu:hover {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Nút menu hover */
.menu-btn:hover {
    background: #fff;
    color: #000;
}

/* Li menu */
#menu li {
    position: relative; /* để ::before căn trái */
    padding: 8px 10px 8px 22px; /* top right bottom left */
    color: #000;
    text-align: left;
    cursor: pointer;
    transition: background 0.3s;
}

/* Hover li */
#menu li:hover {
    background: #ffd000;
}

/* Icon trước li */
#menu li::before {
    content: "";
    position: absolute;
    left: 5px; /* cách trái menu 5px */
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background-size: contain;
    background-repeat: no-repeat;
}

/* Icon riêng từng li */
#menu li.item1::before {
    background-image: url('image/zalo.webp');
}

#menu li.item2::before {
    background-image: url('image/facebook.webp');
}

#menu li.item3::before {
    background-image: url('image/tiktok.png');
}

.sky {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.meteor {
    position: absolute;
    top: -20%;
    width: 0;
    height: 0;
    transform: rotate(45deg);
    animation-name: fall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}


.meteor::before {
    content: "✸";
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle,
        #ffffff 0%,
        #ffffff 40%,
        rgba(127, 252, 255, 0) 70%);
    border-radius: 50%;
    box-shadow: 0 0 12px #7ffcff;
    animation: spin 1.2s linear infinite;
}

.meteor::after {
    content: "";
    position: absolute;
    top: calc(-1 * var(--tail));
    left: 6px;
    width: 2px;
    height: var(--tail);
    background: linear-gradient(
        to bottom,
        rgba(127, 252, 255, 0),
        rgba(127, 252, 255, 1)
    );
}

@keyframes fall {
    0% {
        transform: translate(0, 0) rotate(45deg);
        opacity: 0;
    }
    10% { opacity: 1; }
    100% {
        transform: translate(-900px, 900px) rotate(45deg);
        opacity: 0;
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}


.magic {
    display: inline-flex;
    align-items: center;

    height: 80px;
    padding: 0px;
    border-radius: 5px;
    font-size: 60px;
    font-weight: bold;

    background-image: linear-gradient(
    120deg,
    #0ea5e9, 
    #2563eb,
    #2563eb,
    #4f46e5,   
    #7c3aed,   
    #c026d3,   
    #ec4899,
    #0ea5e9, 
    #2563eb,
    #2563eb,
    #2563eb
    
    
);
    background-size: 400% 400%;
    background-position: 0% 50%;

    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;

    animation: moveColor 12s ease-in-out infinite;
    filter: saturate(1.15);
    will-change: background-position;

}

@keyframes moveColor {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}



.desc {
  font-family: monospace;
  font-size: 22px;
  color: #00ffcc;
  position: relative;
}

.glitch-char {
  display: inline-block;
  position: relative;
  color: #ff003c;
  animation: glitchStrong 0.45s steps(2, end) infinite;
}

@keyframes glitchStrong {
  0% {
    transform: translate(0, 0) scaleX(1);
    text-shadow: none;
  }
  20% {
    transform: translate(-2px, 1px) scaleX(2.5);
    text-shadow: -2px 0 red, 2px 0 cyan;
  }
  40% {
    transform: translate(3px, -1px) scaleX(0.3);
  }
  60% {
    transform: translate(-4px, 0) scaleX(3);
  }
  100% {
    transform: translate(0, 0) scaleX(1);
    text-shadow: none;
  }
}


button {
    padding: 10px 20px;
    background: green;
    color: white;
    border: none;
}

.typing {
    width: 45ch;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    border-right: 1px solid rgb(255, 255, 255);
    animation: typing 3s steps(45), blink 1s infinite;
    font-size: 40px;
}

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 45ch;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}
.popup {
    color: #202124;
    width: 380px;
    padding: 32px;
    background: #fff;
    border-radius: 12px;
}

.tieude {
    font-size: 22px;
    font-weight: 500;
    margin-bottom: 35px;
    color: black;
}


.field {
    position: relative;
    margin-bottom: 31px;
}

.field input {
    width: 93%;
    padding: 14px 12px;
    font-size: 16px;
    border: 1.5px solid #dadce0;
    border-radius: 4px;
    outline: none;
    background: transparent;
    transition: border-color .3s ease;
}

/* Label nằm TRONG khung */
.field label {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #5f6368;
    font-size: 16px;
    background: #ffffff00; /* QUAN TRỌNG */
    padding: 0 6px;
    pointer-events: none;
    z-index: 2;

    transition: 
        top .3s ease,
        font-size .3s ease,
        color .3s ease;
}

/* Focus border */
.field input:focus {
    border-color: #1a73e8;
}
.field input:focus + label {
    color: #1a73e8;
}
.field input:not(:focus):not(:placeholder-shown) + label {
    color: #5f6368;
}

.field input:focus ~ label,
.field input:not(:placeholder-shown) + label {
    top: 0px;
    font-size: 13px;
    color: #1a73e8;
}
/* HỢP LỆ NHƯNG KHÔNG FOCUS → TRỞ VỀ XÁM */
.field.valid input:not(:focus) {
    border-color: #dadce0;
}

.field.valid input:not(:focus) + label {
    color: #5f6368;
}


/* Tạo lớp nền để cắt viền */
.field label::before {
    content: "";
    position: absolute;
    left: -2px;
    right: -2px;
    top: 50%;
    height: 14px;               /* che dư viền */
    background: #fff;           /* TRÙNG MÀU POPUP */
    transform: translateY(-50%);
    z-index: -1;                /* ngay sau chữ */
    pointer-events: none;
}
.field .error {
    position: absolute;
    bottom: -18px;
    left: 2px;
    font-size: 12px;
    color: #d93025;
    opacity: 0;
    transition: opacity .2s ease;
}

.field.invalid .error {
    opacity: 1;
}

.field.invalid input {
    border-color: #d93025;
}

.field.valid input {
    border-color: #1a73e8;
}

.field.valid label {
    color: #1a73e8;
}



/* Checkbox */
.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 24px;
}

.login-btn {
    width: 100%;
    padding: 10px;
    background: #1a73e8; /* xanh ban đầu */
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 15px;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;
    overflow: hidden;
}

/* nền xám phủ toàn bộ */
.login-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: #e5e7eb; /* xám */
    opacity: 0;
    transition: opacity .15s ease;
    z-index: 0;
}

/* lớp xanh chạy */
.login-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: #1a73e8;
    width: 0%;
    z-index: 1;
    transition: width 3s cubic-bezier(0.88, 1, 0.78, 1)
}

/* chữ */
.btn-text {
    position: relative;
    z-index: 2;
    transition: color .2s ease;
}

/* KHI CLICK */
.login-btn.processing::before {
    opacity: 1; /* nền xám hiện ngay */
}

.login-btn.processing::after {
    width: 100%; /* xanh chạy tới 100% và dừng */
}

.login-btn.processing .btn-text {
    color: #fff;
}


.login-btn:disabled {
    background: #dadce0;
    color: #5f6368;
    cursor: not-allowed;
}


/* Links */
.links {
    margin-top: 16px;
}

.links a,
.register a {
    color: #1a73e8;
    font-size: 14px;
    text-decoration: none;
}

.overlay {
    position: fixed;
    inset: 0;

    background: rgba(0, 0, 0, 0.7);

    opacity: 0;
    pointer-events: none;

    transition: opacity 180ms cubic-bezier(.2,.8,.2,1);

    z-index: 999;
    will-change: opacity;
}



.overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(.96);
    opacity: 0;
    pointer-events: none;
    transition: 
        opacity .25s ease,
        transform .25s ease;
    z-index: 1000;
}
.close-popup {
    position: absolute;
    top: 14px;
    right: 14px;

    width: 32px;
    height: 32px;

    border: none;
    border-radius: 3px;
    background: transparent;

    font-size: 22px;
    line-height: 1;
    cursor: pointer;

    color: #5f6368;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: background .2s ease, color .2s ease;
}

.close-popup:hover {
    background: rgba(60,64,67,.1);
    color: #202124;
}

.close-popup:active {
    background: rgba(60,64,67,.2);
}

.popup.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

/* ƯU TIÊN CAO NHẤT KHI LỖI */
.field.invalid label {
    color: #d93025 !important;
}
