/* Dropdown avatar anchor */
.profile-photo-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
}

.profile-summary-card img {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #d7e4ff;
    flex: 0 0 auto;
    display: block;
}
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Inter", sans-serif;
    color: #0f1f3a;
    background:
        radial-gradient(circle at 10% 15%, #dbe8ff 0%, transparent 35%),
        radial-gradient(circle at 90% 85%, #ffe9cc 0%, transparent 30%),
        linear-gradient(160deg, #f7fbff 0%, #eef3ff 45%, #fdf8ef 100%);
    display: grid;
    place-items: center;
    padding: 1.2rem;
}

.auth-shell {
    width: min(980px, 100%);
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #d5e0f6;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 48px rgba(12, 36, 92, 0.16);
}

.auth-aside {
    background: linear-gradient(165deg, #0f3d9c 0%, #1e63df 55%, #6ca0ff 100%);
    color: #ffffff;
    padding: 2.2rem;
    display: grid;
    gap: 1rem;
    align-content: center;
}

.auth-aside h1 {
    margin: 0;
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    line-height: 1.1;
}

.auth-aside p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.45;
    color: #e8f0ff;
}

.auth-main {
    padding: 2rem;
    display: grid;
    gap: 0.85rem;
    align-content: center;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: #163d90;
    font-weight: 800;
    font-size: 1.05rem;
}

.brand img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.brand.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.2em;
}

.brand.login-logo img {
    width: 110px;
    height: auto;
    object-fit: contain;
    margin: 0 auto 0.5em auto;
    display: block;
}

.status {
    min-height: 1.25rem;
    font-size: 0.86rem;
    color: #3a4f77;
}

.status.error {
    color: #a32626;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.btn {
    border: 1px solid #c4d2ef;
    background: #ffffff;
    color: #143877;
    border-radius: 11px;
    padding: 0.7rem 0.95rem;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}

.btn.primary {
    background: #1958d5;
    border-color: #1958d5;
    color: #ffffff;
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.kv {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.35rem;
    padding: 0.8rem;
    background: #f7f9ff;
    border: 1px solid #dde6f8;
    border-radius: 12px;
}

.kv-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.86rem;
}

.kv-row b {
    color: #1f3f7e;
}

.login-main {
    padding: 1.2rem 1rem 1.25rem 1rem;
    gap: 0.55rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.login-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.25rem;
    text-align: center;
}

.login-title {
    margin: 0;
    font-size: 1.4rem;
    color: #133a90;
    font-weight: 800;
}

.login-subtitle {
    margin: 0;
    font-size: 0.88rem;
    color: #4d5f85;
    line-height: 1.4;
    font-weight: 500;
}

.login-actions .btn {
    width: 100%;
    max-width: 340px;
    justify-content: center;
    font-size: 0.93rem;
    padding: 0.66rem 0.85rem;
    border-radius: 10px;
    box-shadow: none;
    font-weight: 700;
}

.auth-back {
    text-align: center;
    font-size: 0.84rem;
    color: #4d5f85;
    text-decoration: none;
    margin-top: 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    font-weight: 600;
    transition: color 0.18s;
}

.auth-back:hover {
    text-decoration: underline;
    color: #1958d5;
}

body.login-page {
    padding: 0.65rem;
    background: #ffffff;
}

.login-shell {
    width: min(390px, 100%);
    grid-template-columns: 1fr;
    border-radius: 24px;
    background: #ffffff;
    border-color: #e7ecf5;
    box-shadow: 0 10px 24px rgba(15, 31, 58, 0.08);
}

.login-main .brand.login-logo {
    margin-bottom: -0.1rem;
}

.login-main .brand.login-logo img {
    width: 84px;
    margin: 0;
}

.login-actions {
    width: 100%;
    max-width: 320px;
    display: grid;
    gap: 0.52rem;
}

.auth-recaptcha-wrap {
    width: 100%;
    display: grid;
    justify-items: center;
    gap: 0.4rem;
    margin-top: 0.1rem;
}

.auth-recaptcha-wrap .g-recaptcha {
    transform-origin: center top;
}

.login-main .status {
    width: 100%;
    text-align: center;
}

.post-verify-box {
    width: 100%;
    max-width: 320px;
    border: 1px solid #d6e2fb;
    border-radius: 10px;
    background: #f5f9ff;
    padding: 0.62rem;
    display: grid;
    gap: 0.45rem;
    text-align: center;
}

.post-verify-box[hidden] {
    display: none !important;
}

.post-verify-copy {
    margin: 0;
    font-size: 0.8rem;
    color: #2d4673;
    line-height: 1.35;
}

.post-verify-box .btn {
    justify-self: center;
    min-width: 130px;
}

.auth-form {
    width: 100%;
    display: grid;
    gap: 0.42rem;
}

.auth-field {
    display: grid;
    gap: 0.22rem;
    font-size: 0.82rem;
    color: #2f4876;
    text-align: left;
}

.auth-field[hidden] {
    display: none !important;
}

.auth-consent {
    display: grid;
    grid-template-columns: 16px 1fr;
    gap: 0.55rem;
    align-items: start;
    font-size: 0.78rem;
    line-height: 1.35;
    color: #3a4f77;
    margin-top: 0.08rem;
}

.auth-consent[hidden] {
    display: none !important;
}

.auth-consent input[type="checkbox"] {
    margin: 0.18rem 0 0;
    width: 14px;
    height: 14px;
}

.auth-consent a {
    color: #1f5fd2;
    font-weight: 700;
    text-decoration: none;
}

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

.auth-field input {
    width: 100%;
    border: 1px solid #c7d4ef;
    border-radius: 9px;
    padding: 0.58rem 0.66rem;
    font: inherit;
    color: #0f2550;
    background: #ffffff;
}

.auth-field select {
    width: 100%;
    border: 1px solid #c7d4ef;
    border-radius: 9px;
    padding: 0.58rem 0.66rem;
    font: inherit;
    color: #0f2550;
    background: #ffffff;
}

.auth-field input:focus {
    outline: 2px solid #cfe0ff;
    border-color: #2b66d8;
}

.auth-field select:focus {
    outline: 2px solid #cfe0ff;
    border-color: #2b66d8;
}

.session-mode-options {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    flex-wrap: wrap;
    width: 100%;
}

.session-mode-option {
    display: inline-flex;
    gap: 0.38rem;
    align-items: center;
    font-size: 0.79rem;
    line-height: 1.3;
    color: #2f4876;
}

.session-mode-option input[type="checkbox"] {
    margin: 0;
    width: 14px;
    height: 14px;
}

#sessionModeWrap {
    justify-items: center;
    text-align: center;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}

.auth-separator {
    text-align: center;
    font-size: 0.73rem;
    color: #6a7ca0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0.1rem 0;
}

.btn-google,
.btn.primary.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: row-reverse;
    gap: 0.5rem;
    background: #f7f8fa;
    color: #111111;
    border-color: #d5dbe8;
}

.btn-google:hover,
.btn.primary.btn-google:hover {
    background: #dff7e8;
    border-color: #b9eccc;
    color: #111111;
}

.google-btn-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.auth-back {
    margin-left: auto;
    margin-right: auto;
    justify-self: center;
}

.auth-switch {
    font-size: 0.84rem;
    color: #4c5f86;
    text-align: center;
    margin-top: 0.1rem;
}

.auth-switch a {
    color: #1958d5;
    font-weight: 700;
    text-decoration: none;
}

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

.auth-forgot {
    border: none;
    background: transparent;
    color: #2b66d8;
    font: inherit;
    font-size: 0.83rem;
    font-weight: 700;
    padding: 0;
    margin: 0.05rem auto 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-forgot:hover {
    color: #1d4fb0;
}

@media (max-width: 600px) {
    body.login-page {
        padding: 0.5rem;
    }

    .login-main {
        padding: 0.92rem 0.78rem 0.98rem;
    }
}

@media (max-width: 860px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }
}

body.profile-page {
    padding: 0.85rem;
    background: #ffffff;
}

.profile-shell {
    width: min(460px, 100%);
    grid-template-columns: 1fr;
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid #e7ecf5;
    box-shadow: 0 10px 24px rgba(15, 31, 58, 0.08);
}

.profile-main {
    padding: 1.1rem 0.95rem 1.15rem;
    gap: 0.65rem;
    align-items: center;
}

.profile-head {
    margin-top: 0;
}

.profile-main .status {
    width: 100%;
    text-align: center;
}

.profile-summary-card {
    width: 100%;
    max-width: 320px;
    margin: 0.35rem auto 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
    padding: 0.1rem 0;
    border: none;
    border-radius: 0;
    background: transparent;
    position: relative;
}
.profile-photo-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
}

.profile-photo-edit-indicator {
    position: absolute;
    right: -4px;
    bottom: -2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: #1f62da;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(15, 31, 58, 0.14);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.12 2.12 0 1 1 3 3L7 19l-4 1 1-4 12.5-12.5Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px 12px;
    pointer-events: none;
}

.profile-summary-copy {
    min-width: 0;
    display: grid;
    gap: 0.18rem;
}

.profile-summary-copy strong {
    color: #163d90;
    font-size: 0.97rem;
}

.profile-summary-copy span {
    color: #4d5f85;
    font-size: 0.82rem;
    word-break: break-word;
}

.profile-avatar-picker {
    width: 100%;
    max-width: 320px;
    margin: 0.2rem auto 0.35rem;
    display: grid;
    gap: 0.45rem;
    position: absolute;
    left: 50%;
    top: 80px;
    z-index: 20;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(12,36,92,0.18);
    border: 1px solid #e7ecf5;
    padding: 1.1rem 1.2rem 1.2rem 1.2rem;
    transform: translateX(-50%);
}

.profile-avatar-picker[hidden] {
    display: none !important;
}

.profile-avatar-picker h2 {
    margin: 0;
    text-align: center;
    font-size: 0.92rem;
    color: #e67e22;
}

.profile-avatar-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.42rem;
}

.profile-avatar-option {
    border: 1px solid #d4def3;
    border-radius: 12px;
    background: #ffffff;
    padding: 0.35rem 0.2rem;
    display: grid;
    gap: 0.2rem;
    justify-items: center;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.profile-avatar-option:hover {
    border-color: #8eb2f4;
    transform: translateY(-1px);
}

.profile-avatar-option:focus-visible {
    outline: 2px solid #cfe0ff;
    border-color: #2b66d8;
}

.profile-avatar-option img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(15, 31, 58, 0.16);
}

.profile-avatar-option span {
    font-size: 0.68rem;
    font-weight: 700;
    color: #3b4f7a;
    line-height: 1;
}

.profile-avatar-option.selected {
    border-color: #1f62da;
    box-shadow: 0 0 0 2px rgba(31, 98, 218, 0.15);
}

.profile-actions-stack {
    max-width: 320px;
    gap: 0.62rem;
}

.profile-form {
    gap: 0.62rem;
    width: 100%;
}

.profile-block {
    display: grid;
    gap: 0.62rem;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
}

.profile-block-head {
    display: grid;
    gap: 0.2rem;
    text-align: center;
}

.profile-block-head h2 {
    margin: 0;
    font-size: 0.98rem;
    color: #e67e22;
}

.profile-block-head p {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.35;
    color: #5b6c91;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.profile-gender-row {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 0.35rem;
    margin-bottom: 0.5rem;
}

.profile-gender-options-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    white-space: nowrap;
}

.profile-gender-check {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    font-size: 0.97rem;
    font-weight: 400;
    color: #2f4876;
    white-space: nowrap;
}

.profile-gender-check input[type="checkbox"] {
    width: 1.1em;
    height: 1.1em;
    margin: 0;
    accent-color: #1976d2;
}

.profile-gender-check span {
    margin: 0;
    padding: 0;
    line-height: 1;
}

.profile-phone-field {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 360px;
    justify-self: center;
}

.profile-id-field {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 360px;
    justify-self: center;
}

.profile-phone-row {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 0.45rem;
    align-items: center;
}

.profile-id-row {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 0.45rem;
    align-items: center;
}

#profileIdNumber:disabled {
    background: #e7ebf0;
    color: #657181;
    border-color: #c5ced8;
    cursor: not-allowed;
}

#profileIdPrefix {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 1.8rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%23284b8f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.55rem center;
    background-size: 0.9rem;
}

.profile-address-section {
    display: grid;
    gap: 0.48rem;
}

.profile-address-label-row {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: #2f4876;
    text-align: left;
}

.profile-address-title {
    display: block;
    font-size: 0.82rem;
    color: #2f4876;
    text-align: left;
}

.profile-address-section #addAddressBtn {
    justify-self: start;
    min-width: 0;
    padding: 0.46rem 0.7rem;
    font-size: 0.8rem;
}

.profile-addresses {
    display: grid;
    gap: 0.45rem;
}

.profile-address-row {
    display: flex;
    gap: 0.4rem;
}

.profile-address-row .profile-field,
.profile-address-row .auth-field {
    flex: 1;
}

.profile-address-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
}

.profile-remove-address {
    border: none;
    background: transparent;
    color: #64789f;
    cursor: pointer;
    min-width: auto;
    padding: 0;
    font-weight: 700;
    font-size: 0.79rem;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.profile-remove-address:hover {
    color: #2b66d8;
}

.profile-address-row textarea,
.auth-field textarea {
    width: 100%;
    min-height: 90px;
    height: 90px;
    resize: none;
    overflow-y: auto;
    border: 1px solid #c7d4ef;
    border-radius: 0;
    padding: 0.58rem 0.66rem;
    font: inherit;
    color: #0f2550;
    background: #ffffff;
}

.profile-address-row textarea:focus,
.auth-field textarea:focus {
    outline: 2px solid #cfe0ff;
    border-color: #2b66d8;
}

.profile-actions-row {
    display: grid;
    gap: 0.5rem;
}

.profile-actions-row .btn {
    width: 100%;
    justify-content: center;
}

.profile-continue-btn {
    background: #20b15a;
    border-color: #20b15a;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
}

.profile-continue-btn:hover {
    background: #19944a;
    border-color: #19944a;
    color: #ffffff;
    text-decoration: none;
}

.profile-orders {
    display: grid;
    gap: 0.45rem;
}

.profile-order-item {
    border: 1px solid #dfe6f5;
    background: #f8fbff;
    border-radius: 10px;
    padding: 0.65rem;
    font-size: 0.81rem;
    color: #2f4c82;
    text-align: left;
}

.profile-order-item strong {
    display: block;
    color: #113a95;
    margin-bottom: 0.25rem;
}

@media (max-width: 600px) {
    body.profile-page {
        padding: 0.5rem;
    }

    .profile-main {
        padding: 0.92rem 0.78rem 0.98rem;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }

    .profile-gender-options-row {
        gap: 0.6rem;
    }

    .profile-gender-row {
        margin-top: 0.25rem;
        margin-bottom: 0.42rem;
    }

    .profile-avatar-options {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .profile-address-label-row {
        align-items: flex-start;
        flex-direction: column;
    }
}
