/* --- Cài đặt chung & Font chữ --- */
:root {
    --primary-color: #2ecc71; /* Màu xanh lá cây cho header */
    --glow-color: rgba(46, 204, 113, 0.7);
    --text-color: #ecf0f1;
    --dark-bg: #000000;
    --border-color: rgba(46, 204, 113, 0.3);
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- Hiệu ứng nền Canvas --- */
#brain-particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* --- Header --- */
#main-header {
    background-color: var(--primary-color);
    color: white;
    padding: 0 1rem;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    transition: height 0.3s ease;
}

#main-header.scrolled {
    height: 50px;
}

#main-header h1 {
    font-size: 1rem;
    font-weight: normal;
}

/* --- Nội dung chính --- */
main {
    padding-top: 80px; /* Khoảng trống cho header */
    padding-bottom: 2rem;
}

.logo-container {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-container img {
    max-width: 568px;
    width: 90%;
    height: auto;
}

.main-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    padding: 0 1rem;
}

/* --- Hiệu ứng viền sáng --- */
.glowing-border {
    position: relative;
    padding: 2px; /* Độ dày của viền sáng */
    border-radius: 8px;
    overflow: hidden;
    background: transparent;
}

.glowing-border::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        transparent,
        var(--glow-color),
        transparent 20%
    );
    animation: rotate 4s linear infinite;
    z-index: 1;
}

/* Nội dung bên trong block */
.inner-content {
    background: rgba(10, 10, 10, 0.8); /* Nền tối hơn để nổi bật */
    backdrop-filter: blur(5px);
    border-radius: 6px; /* nhỏ hơn 2px so với container */
    padding: 2rem;
    position: relative;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.2); 
}


@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* --- Cột trái: Form --- */
.form-container {
    flex: 1 1 400px;
    max-width: 450px;
}

.tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.tab-link {
    padding: 0.8rem 1.2rem;
    border: none;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.tab-link.active {
    opacity: 1;
    border-bottom: 2px solid var(--primary-color);
}

.form-content {
    display: none;
}

.form-content.active {
    display: block;
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    font-size: 1rem;
}

.btn {
    width: 100%;
    padding: 0.8rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: #27ae60;
}

.message {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
    min-height: 1.2em; /* Giữ khoảng trống cho thông báo */
}

.message a {
    color: var(--primary-color);
    text-decoration: none;
}

/* --- Cột phải: Thông tin chạy chữ --- */
.info-container {
    flex: 1 1 400px;
    max-width: 450px;
    height: 500px; /* Chiều cao cố định để thấy hiệu ứng cuộn */
}

.info-container .inner-content {
    height: 100%; /* Đảm bảo nội dung chiếm hết chiều cao cho hiệu ứng chạy chữ */
    overflow: hidden;
}

.scrolling-text {
    animation: scroll-up 40s linear infinite;
}

.info-container:hover .scrolling-text {
    animation-play-state: paused;
}

.scrolling-text h2, .scrolling-text p, .scrolling-text ul {
    margin-bottom: 1rem;
}

.scrolling-text ul {
    list-style-position: inside;
    padding-left: 1rem;
}

@keyframes scroll-up {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(-100%);
    }
}


/* --- CSS cho màn hình chúc mừng --- */
#register-success {
    text-align: center;
    position: relative; 
    min-height: 300px; /* Đảm bảo có không gian cho pháo hoa */
}

#fireworks-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.success-message {
    position: relative;
    z-index: 2; 
    padding-top: 2rem;
}

.success-message h3 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.success-message .phone-number {
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 1rem;
}
.success-message .phone-number a {
    color: var(--text-color);
    text-decoration: none;
}


/* --- Footer --- */
footer {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    opacity: 0.7;
}

/* --- Responsive Design --- */
@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
        align-items: center;
    }

    .form-container, .info-container {
        /* **SỬA LỖI QUAN TRỌNG NHẤT** */
        flex-basis: auto;  /* Cho phép chiều cao của item được tính toán tự động */
        width: 100%;       /* Chiếm toàn bộ chiều ngang */
        height: auto;      /* Quan trọng: Cho phép chiều cao tự giãn */
    }

    /* Ghi đè lại chiều cao cố định của info-container trên mobile */
    .info-container {
        height: 300px; /* Giảm chiều cao trên mobile để giao diện cân đối hơn */
    }
}

@media (max-width: 500px) {
    #main-header h1 {
        font-size: 0.8rem;
    }
    
    .inner-content {
        padding: 1.5rem;
    }
}