@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700;800&display=swap');

:root {
    --nhk-red: #e50012;
    --nhk-red-dark: #b8000e;
    --nhk-black: #1a1a1a;
    --nhk-gray-text: #333333;
    --nhk-gray-muted: #767676;
    --nhk-border: #e2e2e2;
    --nhk-bg: #f4f4f4;
}

* {
    box-sizing: border-box;
}

body.auth-body {
    margin: 0;
    min-height: 100vh;
    background: var(--nhk-black);
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.55)),
        repeating-linear-gradient(135deg, #262626 0 2px, #1a1a1a 2px 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    font-family: "Noto Sans JP", "Segoe UI", Arial, sans-serif;
}

.auth-brand {
    text-align: center;
    margin-bottom: 18px;
}

.auth-brand .mark {
    display: inline-block;
    padding: 6px 16px;
    background: var(--nhk-red);
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 3px;
}

.auth-brand h1 {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin-top: 10px;
    letter-spacing: 1px;
}

/* ==========================================
   THẺ TRƯỢT ĐĂNG NHẬP / ĐĂNG KÝ
   ========================================== */

.auth-flip-container {
    position: relative;
    width: 850px;
    max-width: 100%;
    min-height: 520px;
    background: #fff;
    border-top: 5px solid var(--nhk-red);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    transition: height 0.3s ease;
}

.auth-flip-container h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--nhk-black);
    letter-spacing: 0.5px;
    margin: 0 0 6px;
}

.auth-flip-container .auth-subtitle {
    font-size: 13px;
    color: var(--nhk-gray-muted);
    margin: 0 0 20px;
}

.auth-form-box {
    position: absolute;
    right: 0;
    width: 50%;
    height: 100%;
    background: #fff;
    display: flex;
    align-items: center;
    overflow-y: auto;
    padding: 36px 40px;
    z-index: 1;
    transition:
        0.6s ease-in-out 1.2s,
        visibility 0s 1s;
}

.auth-flip-container.active .auth-form-box {
    right: 50%;
}

.auth-form-box.auth-register {
    visibility: hidden;
}

.auth-flip-container.active .auth-form-box.auth-register {
    visibility: visible;
}

.auth-form-box form {
    width: 100%;
}

.auth-field {
    margin-bottom: 16px;
}

.auth-field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--nhk-gray-muted);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.auth-field input[type="text"],
.auth-field input[type="password"],
.auth-field input[type="email"],
.auth-field input[type="file"],
.auth-field textarea {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--nhk-border);
    border-radius: 2px;
    font-size: 14px;
    color: var(--nhk-black);
    outline: none;
    transition: border-color .2s;
    font-family: inherit;
}

.auth-field textarea {
    height: auto;
    padding: 10px 12px;
    resize: vertical;
}

.auth-field input:focus,
.auth-field textarea:focus {
    border-color: var(--nhk-red);
}

.auth-field .auth-choice-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    font-size: 13.5px;
    color: var(--nhk-gray-text);
}

.auth-field .auth-choice-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 400;
    color: var(--nhk-gray-text);
    margin-bottom: 0;
}

.auth-field .auth-choice-row input {
    accent-color: var(--nhk-red);
}

.auth-btn {
    width: 100%;
    height: 46px;
    border: none;
    background: var(--nhk-red);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background .2s;
    margin-top: 6px;
}

.auth-btn:hover {
    background: var(--nhk-red-dark);
}

.auth-error {
    width: 100%;
    text-align: center;
    color: #fff;
    background: var(--nhk-red);
    font-weight: 600;
    font-size: 13px;
    padding: 10px;
    margin-bottom: 16px;
}

/* Tấm trượt bên phải/trái */
.auth-toggle-box {
    position: absolute;
    width: 100%;
    height: 100%;
}

.auth-toggle-box::before {
    content: "";
    position: absolute;
    left: -250%;
    width: 300%;
    height: 100%;
    background: var(--nhk-black);
    background-image: repeating-linear-gradient(135deg, #262626 0 2px, #1a1a1a 2px 40px);
    border-radius: 150px;
    z-index: 2;
    transition: 1.8s ease-in-out;
}

.auth-flip-container.active .auth-toggle-box::before {
    left: 50%;
}

.auth-toggle-panel {
    position: absolute;
    width: 50%;
    height: 100%;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 30px;
    z-index: 2;
    transition: 0.6s ease-in-out;
}

.auth-toggle-panel .mark {
    display: inline-block;
    padding: 5px 14px;
    background: var(--nhk-red);
    color: #fff;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 2px;
    margin-bottom: 14px;
}

.auth-toggle-panel h2 {
    color: #fff;
    font-size: 22px;
    margin-bottom: 10px;
}

.auth-toggle-panel p {
    margin-bottom: 20px;
    font-size: 13.5px;
    color: #cfcfcf;
}

.auth-toggle-panel .auth-btn {
    width: 170px;
    background: transparent;
    border: 2px solid #fff;
}

.auth-toggle-panel .auth-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.auth-toggle-panel.auth-toggle-left {
    left: 0;
    transition-delay: 1.2s;
}

.auth-flip-container.active .auth-toggle-panel.auth-toggle-left {
    left: -50%;
    transition-delay: 0.6s;
}

.auth-toggle-panel.auth-toggle-right {
    right: -50%;
    transition-delay: 0.6s;
}

.auth-flip-container.active .auth-toggle-panel.auth-toggle-right {
    right: 0;
    transition-delay: 1.2s;
}

.auth-back-link {
    display: block;
    text-align: center;
    margin-top: 18px;
    color: #cfcfcf;
    font-size: 13px;
    text-decoration: none;
}

.auth-back-link:hover {
    color: #fff;
}

@media screen and (max-width: 650px) {
    .auth-flip-container {
        height: auto;
        min-height: 0;
    }

    .auth-form-box {
        position: relative;
        width: 100%;
        right: 0 !important;
        padding: 30px 22px;
        display: none;
    }

    .auth-flip-container:not(.active) .auth-form-box.auth-login {
        display: flex;
        visibility: visible;
    }

    .auth-flip-container.active .auth-form-box.auth-register {
        display: flex;
    }

    .auth-toggle-box,
    .auth-toggle-box::before {
        display: none;
    }

    .auth-mobile-toggle {
        text-align: center;
        padding: 16px 22px 22px;
        border-top: 1px solid var(--nhk-border);
        font-size: 13.5px;
        color: var(--nhk-gray-muted);
        display: block;
    }

    .auth-mobile-toggle a {
        color: var(--nhk-red);
        font-weight: 700;
        text-decoration: none;
        cursor: pointer;
    }
}

@media screen and (min-width: 651px) {
    .auth-mobile-toggle {
        display: none;
    }
}