/* ======== GLOBAL ======== */
body {
    font-family: "Noto Sans JP", sans-serif;
    background: linear-gradient(135deg, #e9eef8, #f4f6fb);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
}

/* ======== CARD / CONTAINER ======== */
.container {
    width: 420px;
    background: #fff;
    padding: 40px 45px;
    border-radius: 18px;
    box-shadow: 0 12px 35px rgba(0,0,0,0.12);
    animation: fadeIn 0.4s ease;
}

/* Animation mượt khi hiện form */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ======== TITLE ======== */
.container h2 {
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    color: #333;
    margin-bottom: 28px;
}

/* ======== LABEL ======== */
.container label {
    font-size: 15px;
    font-weight: 600;
    color: #4a4a4a;
    margin-bottom: 6px;
    display: block;
}

/* ======== INPUT ======== */
.container input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #d3d7e0;
    border-radius: 10px;
    box-sizing: border-box;
    margin-bottom: 18px;
    font-size: 15px;
    transition: all 0.25s ease;
    background: #f6f8fc;
}

.container input:focus {
    border-color: #4a90e2;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(74,144,226,0.15);
    outline: none;
}

/* ======== PASSWORD TOGGLE ======== */
.password-field {
    position: relative;
    width: 100%;
    margin-bottom: 18px;
}

.password-field input {
    padding-right: 44px;
    margin-bottom: 0;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #6a7180;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: none;
}

.toggle-password i {
    display: block;
    line-height: 1;
    font-size: 18px;
}

.toggle-password:hover {
    transform: translateY(-50%);
    box-shadow: none;
    color: #3c7ed7;
}

.toggle-password:active {
    transform: translateY(-50%);
    box-shadow: none;
}

.toggle-password:focus {
    outline: none;
}

.toggle-password:focus-visible {
    outline: 3px solid rgba(74,144,226,0.25);
    outline-offset: 2px;
}

/* ======== BUTTON ======== */
button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4a90e2, #3c7ed7);
    border: none;
    color: white;
    font-size: 17px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.23s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0px 6px 14px rgba(74,144,226,0.35);
}

/* ======== LINK + TEXT ======== */
p {
    text-align: center;
    margin-top: 18px;
}

a {
    color: #3c7ed7;
    font-weight: 600;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}
/* ======= TOAST UI ======= */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 18px;
    border-radius: 10px;
    color: white;
    font-size: 15px;
    min-width: 250px;
    max-width: 340px;
    box-shadow: 0px 4px 15px rgba(0,0,0,0.15);
    animation: slideIn 0.4s ease, fadeOut 0.6s ease 3.2s forwards;
    font-weight: 500;
}

.toast-success {
    background: #4CAF50;
}

.toast-error {
    background: #F44336;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(60px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; transform: translateX(60px); }
}

/* ===========================================
   📱 RESPONSIVE FOR iPHONE & MOBILE
=========================================== */

/* iPhone SE / iPhone 8 (≤ 375px) */
@media (max-width: 380px) {

    body {
        height: auto;
        padding: 20px;
        align-items: flex-start;
    }

    .container {
        width: 100%;
        padding: 28px 22px;
        border-radius: 14px;
    }

    .container h2 {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .container input {
        padding: 11px 12px;
        font-size: 14px;
        margin-bottom: 14px;
    }

    .password-field {
        margin-bottom: 14px;
    }

    .password-field input {
        padding-right: 56px;
    }

    .toggle-password {
        width: 40px;
        height: 40px;
        right: 8px;
    }

    .toggle-password i {
        font-size: 20px;
    }

    button {
        padding: 12px;
        font-size: 15px;
    }

    p {
        font-size: 14px;
        margin-top: 14px;
    }
}

/* iPhone 11 / 12 / 13 / 14 / 15 (≤ 430px) */
@media (max-width: 430px) {

    body {
        padding: 25px;
    }

    .container {
        width: 100%;
        max-width: 380px;
        padding: 32px 26px;
    }

    input {
        padding: 12px 13px;
        font-size: 15px;
    }

    .password-field input {
        padding-right: 56px;
    }

    .toggle-password {
        width: 40px;
        height: 40px;
        right: 8px;
    }

    .toggle-password i {
        font-size: 20px;
    }

    button {
        font-size: 16px;
        padding: 13px;
    }
}

/* iPhone 12–15 Pro Max */
@media (max-width: 460px) {

    body {
        padding: 20px;
        align-items: flex-start;
    }

    .container {
        max-width: 360px;
        padding: 28px 24px;
        border-radius: 16px;
    }

    .container h2 {
        font-size: 22px;
    }

    .container input {
        font-size: 15px;
        padding: 12px;
    }

    .password-field input {
        padding-right: 56px;
    }

    .toggle-password {
        width: 40px;
        height: 40px;
        right: 8px;
    }

    .toggle-password i {
        font-size: 20px;
    }

    button {
        font-size: 16px;
        padding: 13px;
    }
}


/* iPad dọc (600px – 900px) */
@media (min-width: 600px) and (max-width: 900px) {

    .container {
        width: 520px;
        padding: 10px 48px;
    }

    h2 {
        font-size: 28px;
    }

    input {
        font-size: 16px;
        padding: 14px 16px;
    }

    button {
        font-size: 18px;
        padding: 15px;
    }
}
