/* =========================================================
   PTK AUTH DESIGNER v2.0.0 — SAFE MODE
   โหลดเฉพาะหน้า [ptk_auth]
========================================================= */

body.ptk-auth-page {
    min-height: 100vh;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
}

body.ptk-auth-page #page,
body.ptk-auth-page .site,
body.ptk-auth-page .site-content,
body.ptk-auth-page .content-area,
body.ptk-auth-page main#primary,
body.ptk-auth-page article,
body.ptk-auth-page .entry-content {
    background-color: transparent;
}

body.ptk-auth-page .entry-header,
body.ptk-auth-page .page-header {
    display: none;
}

body.ptk-auth-page .entry-content {
    margin-top: 0;
}

body.ptk-auth-page .ptk-auth-container {
    width: 100%;
    max-width: 1220px;
    margin: 38px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.ptk-auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(440px, .98fr);
    min-height: 690px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 28px;
    background: #101217;
    box-shadow: 0 30px 90px rgba(0,0,0,.42);
    isolation: isolate;
}

.ptk-auth-visual {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-width: 0;
    padding: 44px;
    color: #fff;
    background-color: #17191f;
    background-image:
        radial-gradient(circle at 20% 16%, rgba(205,164,75,.32), transparent 34%),
        linear-gradient(145deg, #25221c 0%, #14161c 44%, #08090c 100%);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    box-sizing: border-box;
}

.ptk-auth-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(4,5,8,.04) 15%, rgba(4,5,8,.82) 100%),
        repeating-linear-gradient(135deg, rgba(255,255,255,.018) 0 1px, transparent 1px 14px);
}

.ptk-auth-visual-content {
    width: min(100%, 500px);
}

.ptk-auth-brand-logo {
    display: block;
    width: auto;
    max-width: 180px;
    max-height: 82px;
    margin: 0 0 24px;
    object-fit: contain;
    object-position: left center;
}

.ptk-auth-eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 11px;
    border: 1px solid rgba(214,180,102,.52);
    border-radius: 999px;
    color: #e1c57e;
    background: rgba(12,13,17,.42);
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .12em;
    box-sizing: border-box;
}

.ptk-auth-visual h2 {
    margin: 18px 0 10px;
    color: #fff;
    font-size: clamp(30px, 3.6vw, 52px);
    line-height: 1.13;
    letter-spacing: -.025em;
    text-wrap: balance;
}

.ptk-auth-visual p {
    max-width: 520px;
    margin: 0;
    color: rgba(255,255,255,.76);
    font-size: 16px;
    line-height: 1.8;
}

.ptk-auth-security-note {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding: 9px 13px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 999px;
    color: rgba(255,255,255,.88);
    background: rgba(6,7,10,.46);
    font-size: 13px;
    backdrop-filter: blur(9px);
}

.ptk-auth-security-note span {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: #101217;
    background: #d6b466;
    font-weight: 900;
}

.ptk-auth-main {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 34px;
    background: linear-gradient(180deg, #15171c 0%, #0d0f13 100%);
    box-sizing: border-box;
}

body.ptk-auth-page .ptk-auth-card {
    width: 100%;
    margin: 0;
    padding: 28px;
    border: 0;
    border-radius: 22px;
    color: #f5f5f5;
    background: rgba(24,26,32,.82);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
    backdrop-filter: blur(14px);
}

.ptk-auth-panel-heading {
    margin-bottom: 22px;
}

.ptk-auth-panel-heading h1 {
    margin: 13px 0 5px;
    color: #fff;
    font-size: clamp(27px, 3vw, 38px);
    line-height: 1.2;
}

.ptk-auth-panel-heading p {
    margin: 0;
    color: #aeb2bb;
    line-height: 1.65;
}

body.ptk-auth-page .ptk-auth-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin: 0 0 22px;
    padding: 5px;
    border: 1px solid #2d3038;
    border-radius: 15px;
    background: #101217;
}

body.ptk-auth-page .ptk-auth-tab {
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #b9bdc6;
    background: transparent;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    transition: .2s ease;
}

body.ptk-auth-page .ptk-auth-tab:hover {
    color: #fff;
    background: #1d2026;
}

body.ptk-auth-page .ptk-auth-tab.is-active {
    border-color: #d6b466;
    color: #17130b;
    background: linear-gradient(135deg, #e2c77e, #b88c38);
    box-shadow: 0 7px 20px rgba(184,140,56,.19);
}

body.ptk-auth-page .ptk-form-row {
    margin-bottom: 14px;
}

body.ptk-auth-page .ptk-form-row label {
    margin-bottom: 7px;
    color: #e6e7ea;
    font-size: 13px;
    font-weight: 700;
}

body.ptk-auth-page .ptk-form-row label small {
    color: #8f949e;
    font-weight: 500;
}

body.ptk-auth-page .ptk-form-row input:not([type="checkbox"]),
body.ptk-auth-page .ptk-form-row textarea,
body.ptk-auth-page .ptk-form-row select {
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid #343740;
    border-radius: 12px;
    color: #fff;
    background: #101217;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

body.ptk-auth-page .ptk-form-row input:not([type="checkbox"]):focus,
body.ptk-auth-page .ptk-form-row textarea:focus,
body.ptk-auth-page .ptk-form-row select:focus {
    outline: none;
    border-color: #c69d49;
    background: #14171c;
    box-shadow: 0 0 0 3px rgba(198,157,73,.14);
}

body.ptk-auth-page .ptk-form-row-inline {
    margin-top: 2px;
}

body.ptk-auth-page .ptk-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #b9bdc6;
    font-weight: 500;
}

body.ptk-auth-page .ptk-checkbox input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: #c69d49;
}

body.ptk-auth-page .ptk-btn-primary {
    border-color: #d1aa55;
    color: #17130b;
    background: linear-gradient(135deg, #e4ca83, #b98e3b);
    box-shadow: 0 9px 25px rgba(185,142,59,.16);
}

body.ptk-auth-page .ptk-btn-primary:hover {
    border-color: #efd795;
    color: #100e09;
    background: linear-gradient(135deg, #efd995, #c99b43);
}

body.ptk-auth-page .ptk-btn-secondary {
    border-color: #363942;
    color: #f3f4f6;
    background: #20232a;
}

.ptk-social-login {
    margin-bottom: 18px;
}

.ptk-social-login-title {
    margin: 0 0 10px;
    color: #c7cad1;
    font-size: 12px;
    font-weight: 700;
}

.ptk-social-login-buttons {
    display: grid;
    gap: 9px;
}

.ptk-social-login-form {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
}

.ptk-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    width: 100%;
    min-height: 47px;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 750;
    line-height: 1.25;
    text-decoration: none !important;
    appearance: none;
    cursor: pointer;
    transition: transform .2s ease, filter .2s ease, border-color .2s ease;
}

.ptk-social-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.ptk-social-btn:focus-visible {
    outline: 3px solid rgba(198,157,73,.28);
    outline-offset: 2px;
}

.ptk-social-btn-google {
    border-color: #dadce0;
    color: #202124 !important;
    background: #fff;
}

.ptk-social-btn-facebook {
    border-color: #2176d9;
    color: #fff !important;
    background: #1877f2;
}

.ptk-social-btn-line {
    border-color: #06b900;
    color: #fff !important;
    background: #06c755;
}

.ptk-social-btn-icon {
    display: inline-grid;
    place-items: center;
    width: 29px;
    height: 29px;
    flex: 0 0 29px;
    border-radius: 8px;
    background: rgba(255,255,255,.16);
    font-size: 15px;
    line-height: 1;
}

.ptk-social-btn-google .ptk-social-btn-icon {
    color: #4285f4;
    background: #f5f6f7;
}

.ptk-social-btn-line .ptk-social-btn-icon {
    width: 38px;
    font-size: 8px;
}

.ptk-auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 17px 0 0;
    color: #858a94;
    font-size: 11px;
}

.ptk-auth-divider::before,
.ptk-auth-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: #30333b;
}

.ptk-otp-send-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -4px 0 14px;
}

.ptk-otp-send-row .ptk-btn {
    flex: 0 0 auto;
    min-height: 38px;
}

.ptk-otp-status {
    color: #9fa4ad;
    font-size: 12px;
    line-height: 1.45;
}

.ptk-otp-status.is-success {
    color: #84db9d;
}

.ptk-otp-status.is-error {
    color: #ff9aa6;
}

body.ptk-auth-page .ptk-otp-input {
    letter-spacing: .28em;
    font-size: 19px;
    font-weight: 800;
    text-align: center;
}

.ptk-auth-privacy-note {
    margin: 12px 0 0;
    color: #8f949d;
    font-size: 11px;
    line-height: 1.6;
    text-align: center;
}

.ptk-social-account-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    padding: 12px;
    border: 1px solid #30333b;
    border-radius: 14px;
    background: #111319;
}

.ptk-social-account-summary img {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border: 1px solid #3b3f49;
    border-radius: 50%;
    object-fit: cover;
}

.ptk-social-account-summary strong,
.ptk-social-account-summary span {
    display: block;
}

.ptk-social-account-summary strong {
    color: #fff;
    font-size: 14px;
}

.ptk-social-account-summary span {
    margin-top: 3px;
    color: #989da7;
    font-size: 12px;
}

.ptk-auth-cancel-link {
    display: block;
    margin-top: 14px;
    color: #aeb2bb;
    font-size: 12px;
    text-align: center;
    text-decoration: none;
}

.ptk-auth-cancel-link:hover {
    color: #e1c57e;
}

body.ptk-auth-page .ptk-alert {
    border: 1px solid transparent;
    font-size: 13px;
    line-height: 1.55;
}

body.ptk-auth-page .ptk-alert-success { border-color: rgba(75,191,111,.3); }
body.ptk-auth-page .ptk-alert-error { border-color: rgba(255,103,122,.32); }
body.ptk-auth-page .ptk-alert-warning { border-color: rgba(220,179,78,.32); }

.ptk-auth-shell-status {
    min-height: 520px;
}

.ptk-auth-shell-status .ptk-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

body.ptk-auth-designer-disabled .ptk-auth-container {
    max-width: 620px;
}

body.ptk-auth-designer-disabled .ptk-auth-shell {
    display: block;
    min-height: 0;
}

body.ptk-auth-designer-disabled .ptk-auth-visual {
    display: none;
}

@media (max-width: 920px) {
    body.ptk-auth-page {
        background-attachment: scroll;
    }

    body.ptk-auth-page .ptk-auth-container {
        max-width: 760px;
        margin: 26px auto;
    }

    .ptk-auth-shell {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .ptk-auth-visual {
        min-height: 250px;
        padding: 30px;
    }

    .ptk-auth-visual h2 {
        max-width: 620px;
        font-size: clamp(28px, 6vw, 42px);
    }

    .ptk-auth-brand-logo {
        max-height: 62px;
        margin-bottom: 17px;
    }

    .ptk-auth-main {
        padding: 24px;
    }
}

@media (max-width: 640px) {
    body.ptk-auth-page .ptk-auth-container {
        margin: 16px auto 24px;
        padding: 0 12px;
    }

    .ptk-auth-shell {
        border-radius: 20px;
    }

    .ptk-auth-visual {
        min-height: 188px;
        padding: 22px;
    }

    .ptk-auth-visual h2 {
        margin-top: 12px;
        font-size: 27px;
    }

    .ptk-auth-visual p {
        font-size: 13px;
        line-height: 1.6;
    }

    .ptk-auth-brand-logo,
    .ptk-auth-security-note {
        display: none;
    }

    body.ptk-auth-mobile-visual-hide .ptk-auth-visual {
        display: none;
    }

    .ptk-auth-main {
        padding: 12px;
    }

    body.ptk-auth-page .ptk-auth-card {
        padding: 20px 16px;
        border-radius: 16px;
    }

    .ptk-auth-panel-heading h1 {
        font-size: 28px;
    }

    body.ptk-auth-page .ptk-auth-tabs {
        gap: 4px;
        padding: 4px;
    }

    body.ptk-auth-page .ptk-auth-tab {
        padding: 8px 5px;
        font-size: 11px;
    }

    .ptk-otp-send-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .ptk-otp-send-row .ptk-btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ptk-social-btn,
    body.ptk-auth-page .ptk-auth-tab,
    body.ptk-auth-page .ptk-form-row input {
        transition: none;
    }
}
