/* =========================
   RESET
========================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body,
h1,
p,
form,
input,
button,
a,
div,
label,
span {
    margin: 0;
    padding: 0;
}

/* =========================
   ROOT
========================= */
:root {
    --brand: #0a58ca;
    --brand-hover: #0847a5;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #d9dee7;
    --bg: #f5f7fb;
    --card: #ffffff;
    --danger-bg: #fdecec;
    --danger-text: #b42318;
    --success-bg: #ecfdf3;
    --success-text: #067647;
    --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

/* =========================
   PAGE
========================= */
body.auth-page {
    min-height: 100vh;
    background: var(--bg);
    font-family: Arial, sans-serif;
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 24px 16px;
    overflow-x: hidden;
    overflow-y: auto;
}

/* =========================
   CARD
========================= */
.auth-card {
    width: 100%;
    max-width: 430px;
    background: var(--card);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 26px 24px 22px;
    margin: 0 auto;
}

.auth-card-login {
    width: 100%;
}

/* =========================
   TITLE + MESSAGES
========================= */
.auth-title {
    text-align: center;
    font-size: 34px;
    line-height: 1.15;
    font-weight: 700;
    color: #111111;
    margin-bottom: 20px;
}

.auth-message {
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.5;
}

.auth-message-error {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.auth-message-success {
    background: var(--success-bg);
    color: var(--success-text);
}

/* =========================
   SOCIAL LOGIN
========================= */
.social-auth {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    flex-wrap: nowrap;
    width: 100%;
}

.social-btn {
    width: 190px;
    height: 46px;
    min-height: 46px;
    border-radius: 999px;
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    text-decoration: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease;
    background: #fff;
    color: inherit;
    appearance: none;
    -webkit-appearance: none;
}

.social-btn span {
    line-height: 1;
}

.social-btn-google {
    color: #202124;
}

.social-btn-google:hover {
    background: #f8fafc;
}

.social-btn-facebook {
    background: #1877f2;
    border-color: #1877f2;
    color: #fff;
}

.social-btn-facebook:hover {
    background: #166fe5;
    border-color: #166fe5;
}

.social-btn i {
    font-size: 16px;
    line-height: 1;
}

.social-icon-img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    display: block;
}

.google-custom-wrap {
    position: relative;
    width: 190px;
    height: 46px;
    flex: 0 0 auto;
    border-radius: 999px;
    overflow: hidden;
}

.google-fake-btn {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.google-real-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: 999px;
    overflow: hidden;
}

.google-real-overlay > div {
    width: 100% !important;
    height: 100% !important;
}

.google-real-overlay iframe,
.google-real-overlay div[role="button"] {
    opacity: 0.01 !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    border-radius: 999px !important;
}

/* =========================
   DIVIDER
========================= */
.auth-divider {
    position: relative;
    text-align: center;
    margin: 18px 0 22px;
}

.auth-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    border-top: 1px solid #d6dbe5;
    transform: translateY(-50%);
}

.auth-divider span {
    position: relative;
    display: inline-block;
    padding: 0 16px;
    background: #fff;
    color: var(--muted);
    font-size: 15px;
}

/* =========================
   FORM
========================= */
.auth-form {
    width: 100%;
}

.form-group {
    margin-bottom: 18px;
    width: 100%;
}

.form-group label {
    display: block;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #4b5563;
    line-height: 1.4;
}

.input-field {
    width: 100%;
    height: 52px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 14px;
    font-size: 15px;
    color: var(--text);
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

.input-field::placeholder {
    color: #9aa3b2;
}

.input-field:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(10, 88, 202, 0.12);
}

.password-wrapper {
    position: relative;
    width: 100%;
}

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

.toggle-password {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: #7b8190;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
}

.toggle-password i {
    font-size: 19px;
    line-height: 1;
}

/* =========================
   LINKS + BUTTON
========================= */
.helper-row {
    display: flex;
    justify-content: flex-end;
    margin: -4px 0 18px;
}

.text-link {
    color: var(--brand);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
}

.text-link:hover {
    text-decoration: underline;
}

.primary-btn {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

.primary-btn:hover {
    background: var(--brand-hover);
}

.bottom-link {
    margin-top: 22px;
    text-align: center;
    font-size: 16px;
    color: #4b5563;
    line-height: 1.5;
}

.bottom-link a {
    color: var(--brand);
    text-decoration: none;
    font-weight: 700;
    margin-left: 4px;
}

.bottom-link a:hover {
    text-decoration: underline;
}

.auth-note {
    margin-top: 20px;
    text-align: center;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.7;
}

.auth-note a {
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
}

.auth-note a:hover {
    text-decoration: underline;
}

/* =========================
   TABLET
========================= */
@media (max-width: 768px) {
    body.auth-page {
        padding: 18px 14px;
    }

    .auth-card {
        max-width: 100%;
        padding: 24px 18px 20px;
        border-radius: 16px;
    }

    .auth-title {
        font-size: 30px;
        margin-bottom: 18px;
    }

    .social-auth {
        gap: 12px;
    }

    .social-btn,
    .google-custom-wrap {
        width: 100%;
        max-width: 100%;
    }
}

/* =========================
   MOBILE
========================= */
@media (max-width: 575px) {
    body.auth-page {
        padding: 12px;
        align-items: flex-start;
    }

    .auth-card {
        width: 100%;
        max-width: 100%;
        padding: 20px 14px 18px;
        border-radius: 14px;
        box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    }

    .auth-title {
        font-size: 28px;
        margin-bottom: 16px;
    }

    .auth-message {
        font-size: 13px;
        padding: 10px 12px;
        margin-bottom: 14px;
    }

    .social-auth {
        display: flex;
        flex-direction: column;   /* stack buttons vertically */
        align-items: center;      /* center horizontally */
        gap: 10px;                /* spacing between buttons */
        margin-bottom: 16px;
    }

    .social-btn,
    .google-custom-wrap {
        width: 100%;
        max-width: 190px;         /* keep consistent with register page */
    }

    .social-btn {
        height: 44px;      /* match register page */
        font-size: 14px;
        padding: 0 16px;
    }

    .social-btn span {
        font-size: 14px;
    }

    .social-btn i {
        font-size: 16px;
    }
}

    .auth-divider {
        margin: 16px 0 18px;
    }

    .auth-divider span {
        font-size: 14px;
        padding: 0 12px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .form-group label {
        font-size: 14px;
        margin-bottom: 7px;
    }

    .input-field {
        height: 48px;
        font-size: 14px;
        padding: 0 12px;
        border-radius: 10px;
    }

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

    .toggle-password {
        right: 10px;
        width: 30px;
        height: 30px;
    }

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

    .helper-row {
        margin: -2px 0 16px;
    }

    .text-link {
        font-size: 14px;
    }

    .primary-btn {
        height: 48px;
        font-size: 15px;
        border-radius: 10px;
    }

    .bottom-link {
        margin-top: 18px;
        font-size: 15px;
    }
}

/* =========================
   EXTRA SMALL DEVICES
========================= */
@media (max-width: 380px) {
    body.auth-page {
        padding: 10px;
    }

    .auth-card {
        padding: 18px 12px 16px;
    }

    .auth-title {
        font-size: 25px;
    }

    .form-group label,
    .text-link,
    .bottom-link {
        font-size: 14px;
    }

    .input-field,
    .primary-btn,
    .social-btn {
        height: 46px;
    }
}