* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

body {
    background: #f0f6fe;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header - màu chủ đạo #0963cc */
.header {
    background: linear-gradient(135deg, #0963cc 0%, #0a4b9e 100%);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 4px 12px rgba(9, 99, 204, 0.2);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    font-size: 2.5rem;
    color: #ffcd3c;
}

.title h1 {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.title p {
    font-size: 0.85rem;
    opacity: 0.9;
}

.exam-name {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.4rem 1rem;
    border-radius: 40px;
    font-weight: 500;
    font-size: 0.9rem;
}

.exam-name i {
    margin-right: 6px;
}

/* Main container */
.container {
    flex: 1;
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* Card tra cứu */
.search-card {
    background: white;
    border-radius: 28px;
    box-shadow: 0 12px 30px rgba(9, 99, 204, 0.1);
    padding: 2rem 1.8rem;
    margin-bottom: 2.5rem;
    transition: all 0.2s;
}

.search-title {
    font-size: 1.7rem;
    font-weight: 700;
    color: #0963cc;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-title i {
    color: #e67e22;
    font-size: 1.8rem;
}

.sub {
    color: #2c5a7a;
    border-left: 4px solid #0963cc;
    padding-left: 12px;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    font-weight: 600;
    color: #0963cc;
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

label i {
    margin-right: 8px;
    color: #0963cc;
}

input {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1.5px solid #dce4ec;
    border-radius: 16px;
    font-size: 1rem;
    transition: 0.2s;
    background-color: #fefefe;
}

input:focus {
    outline: none;
    border-color: #0963cc;
    box-shadow: 0 0 0 3px rgba(9, 99, 204, 0.2);
}

.captcha-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    align-items: center;
}

.captcha-input-inline {
    flex: 1 1 180px;
    min-width: 0;
}

.captcha-code {
    background: #eef3fc;
    padding: 0.8rem 1rem;
    border-radius: 16px;
    font-family: monospace;
    font-size: 1.6rem;
    font-weight: bold;
    letter-spacing: 6px;
    color: #0963cc;
    border: 1px dashed #b3d0f0;
    flex: 1;
    text-align: center;
    -webkit-user-select: none;
    user-select: none;
}

/* Container hiển thị ảnh SVG captcha do server trả về */
.captcha-image {    
    flex: 0 0 180px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;    
    padding: 4px 8px;
}

.captcha-image svg {
    max-height: 56px;
    width: auto;
    display: block;
}

.captcha-placeholder {
    color: #5f7f9e;
    font-size: 0.9rem;
    font-style: italic;
}

.refresh-captcha {
    background: #eef3fc;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.2rem;
    color: #0963cc;
    transition: 0.2s;
    white-space: nowrap;
    flex: 0 0 auto;
}

.refresh-captcha:hover {
    background: #d4e6fc;
    color: #054a8f;
}

.btn-search {
    background: linear-gradient(95deg, #0963cc, #0a4b9e);
    border: none;
    padding: 0.9rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    width: 100%;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-search:hover {
    background: linear-gradient(95deg, #0857b3, #073f85);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(9, 99, 204, 0.3);
}

.btn-search:disabled {
    opacity: 0.6;
    transform: none;
    cursor: not-allowed;
}

/* Result area */
.result-area {
    background: white;
    border-radius: 28px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
    padding: 1.5rem 1.8rem;
    transition: 0.2s;
}

.result-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0963cc;
    border-bottom: 3px solid #ffcd3c;
    display: inline-block;
    padding-bottom: 5px;
    margin-bottom: 1.5rem;
}

.student-summary {
    background: #f9fbfd;
    border: 1px solid #e8eff8;
    border-radius: 16px;
    padding: 0.9rem 1rem;
    margin-bottom: 1.2rem;
}

.student-main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
}

.student-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #184160;
}

.student-code {
    font-size: 0.88rem;
    font-weight: 600;
    color: #0963cc;
    background: #e9f3ff;
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
}

.student-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.meta-chip {
    background: #ffffff;
    border: 1px solid #e4edf7;
    border-radius: 12px;
    padding: 0.45rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.meta-key {
    font-size: 0.7rem;
    color: #6b89a5;
    text-transform: uppercase;
    letter-spacing: 0.35px;
    font-weight: 600;
}

.meta-val {
    font-size: 0.9rem;
    color: #1f3b4c;
    font-weight: 600;
    word-break: break-word;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    background: #f9fbfd;
    padding: 1.2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #5f7f9e;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 1rem;
    font-weight: 500;
    color: #1f3b4c;
    margin-top: 4px;
    word-break: break-word;
}

/* Two columns style for score groups */
.score-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 1.8rem;
    margin-top: 0.5rem;
}

.score-card {
    flex: 1;
    min-width: 250px;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 4px 14px rgba(9, 99, 204, 0.08);
    border: 1px solid #e9f0f9;
    overflow: hidden;
    transition: 0.2s;
}

.score-card-header {
    background: #f0f7ff;
    padding: 1rem 1.2rem;
    border-bottom: 2px solid #0963cc;
    display: flex;
    align-items: center;
    gap: 12px;
}

.score-card-header i {
    font-size: 1.2rem;
    color: #0963cc;
}

.score-card-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0963cc;
    margin: 0;
}

.score-table {
    width: 100%;
    border-collapse: collapse;
}

.score-table th,
.score-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #eef2f8;
}

.score-table th {
    background-color: #fafcff;
    color: #0963cc;
    font-weight: 700;
    width: 45%;
    font-size: 0.9rem;
}

.score-table td {
    font-weight: 500;
    color: #1e4663;
}

.score-table tr:last-child td,
.score-table tr:last-child th {
    border-bottom: none;
}

.error-message {
    background: #ffece5;
    border-left: 6px solid #dc3545;
    padding: 1rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    color: #a1222a;
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 2rem;
    color: #0963cc;
}

footer {
    background: #0963cc;
    color: #e3f0ff;
    text-align: center;
    padding: 1.8rem 1rem;
    margin-top: 2rem;
    font-size: 0.85rem;
    line-height: 1.5rem;
    position: relative;
    min-height: 86px;
}

.footer-main {
    text-align: center;
}

.footer-counter {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

#histats_counter {
    line-height: 1;
}

footer a {
    color: #ffcd7e;
    text-decoration: none;
}

@media (max-width: 750px) {
    .container {
        padding: 0 1rem;
    }

    .student-summary {
        padding: 0.8rem;
    }

    .student-meta-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .search-card,
    .result-area {
        padding: 1.2rem;
    }

    .captcha-row {
        gap: 8px;
    }

    .captcha-input-inline {
        flex-basis: 120px;
    }

    .captcha-image {
        flex-basis: 120px;
        min-height: 52px;
    }

    .refresh-captcha {
        padding: 0.65rem 0.85rem;
        font-size: 0.95rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .score-columns {
        flex-direction: column;
        gap: 1.2rem;
    }

    footer {
        min-height: 0;
    }

    .footer-counter {
        position: static;
        transform: none;
        margin-top: 8px;
        justify-content: center;
        text-align: center;
    }
}

.badge-example {
    font-size: 0.75rem;
    background: #f0f4fa;
    display: inline-block;
    border-radius: 50px;
    padding: 2px 10px;
    margin-top: 6px;
    color: #0963cc;
}
