.page {
    max-width: 430px;
    margin: 0 auto;
    padding: 28px 16px;
}

.brand {
    margin-bottom: 18px;
}

.brand h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.1;
}

.brand p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 15px;
}

.panel {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
}

.panel h2 {
    margin: 0 0 12px;
    font-size: 20px;
}

label {
    display: block;
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
}

input,
button {
    width: 100%;
    max-width: 100%;
    border-radius: 10px;
    font-size: 16px;
}

input {
    margin-top: 6px;
    padding: 13px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
}

button {
    margin-top: 14px;
    padding: 13px 14px;
    border: 0;
    background: var(--accent);
    color: white;
    font-weight: 700;
    cursor: pointer;
    overflow-wrap: anywhere;
}

button:active:not(:disabled) {
    background: var(--accent-dark);
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ghost {
    background: transparent;
    color: var(--accent-dark);
    border: 1px solid var(--line);
}

.ghost:active:not(:disabled) {
    background: var(--soft);
}

.message {
    min-height: 20px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 14px;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.message:empty {
    display: none;
}

.error {
    color: var(--danger);
}

.hidden {
    display: none;
}

.client-login-page {
    min-height: 100vh;
    background:
        linear-gradient(rgba(255, 246, 248, 0.42), rgba(255, 238, 243, 0.58)),
        url("../img/login/marble.png") center / cover fixed;
    color: #2f2028;
}

.client-login-shell {
    width: min(100%, 430px);
    min-height: 100vh;
    padding: 14px 18px 26px;
    transition: opacity 0.18s ease;
}

.client-login-page.otp-open .client-login-shell,
.client-login-page.name-open .client-login-shell {
    opacity: 0.42;
    pointer-events: none;
    user-select: none;
}

.client-hero {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    grid-template-areas:
        "avatar title"
        "avatar subtitle"
        "avatar address"
        "social social";
    align-items: center;
    justify-items: start;
    gap: 4px 14px;
    margin: 0 0 12px;
    text-align: left;
}

.client-hero h1 {
    grid-area: title;
    color: #632d41;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 30px;
    font-weight: 500;
    letter-spacing: 0;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

.hero-subtitle,
.hero-address {
    margin: 0;
    color: #70445a;
    line-height: 1.25;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.hero-subtitle {
    grid-area: subtitle;
    font-size: 13px;
    font-weight: 700;
}

.hero-address {
    grid-area: address;
    font-size: 12px;
}

html[dir="rtl"] .client-hero {
    text-align: right;
}

.profile-avatar {
    grid-area: avatar;
    width: 76px;
    height: 76px;
    padding: 4px;
    border: 1px solid rgba(198, 151, 102, 0.55);
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(255, 251, 247, 0.95), rgba(231, 196, 154, 0.55));
    box-shadow: 0 14px 28px rgba(99, 45, 65, 0.14);
}

.profile-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.social-links {
    grid-area: social;
    display: flex;
    justify-content: center;
    justify-self: center;
    gap: 12px;
    margin-top: 8px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(99, 45, 65, 0.2);
    border-radius: 50%;
    background: rgba(255, 250, 251, 0.55);
    color: #632d41;
    box-shadow: 0 8px 18px rgba(99, 45, 65, 0.09);
}

.social-links img {
    display: none;
}

.social-links a::before {
    content: "";
    display: block;
    width: 21px;
    height: 21px;
    background: currentColor;
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: contain;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
}

.social-links a[aria-label="Waze"]::before {
    mask-image: url("../img/social/waze.svg");
    -webkit-mask-image: url("../img/social/waze.svg");
}

.social-links a[aria-label="Instagram"]::before {
    mask-image: url("../img/social/instagram.svg");
    -webkit-mask-image: url("../img/social/instagram.svg");
}

.social-links a[aria-label="WhatsApp"]::before {
    mask-image: url("../img/social/whatsapp.svg");
    -webkit-mask-image: url("../img/social/whatsapp.svg");
}

.login-card {
    margin: 0 auto;
    padding: 20px;
    border: 1px solid rgba(99, 45, 65, 0.1);
    border-radius: 18px;
    background: rgba(255, 247, 249, 0.9);
    box-shadow: 0 12px 28px rgba(99, 45, 65, 0.12);
    backdrop-filter: blur(10px);
}

.login-card h2 {
    margin: 0 0 10px;
    color: #632d41;
    font-size: 18px;
    text-align: center;
}

.login-hint {
    margin: 0 auto 12px;
    max-width: 310px;
    color: #70445a;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
}

.privacy-notice {
    margin: 10px 2px 0;
    color: #755d68;
    font-size: 11px;
    line-height: 1.45;
    text-align: start;
}

.privacy-notice a {
    color: #632d41;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.login-card label {
    color: #70445a;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.login-card input {
    height: 48px;
    border: 1px solid rgba(99, 45, 65, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.login-card button {
    min-height: 48px;
    border-radius: 12px;
    background: #632d41;
    box-shadow: 0 12px 22px rgba(99, 45, 65, 0.2);
}

.login-card button:active:not(:disabled) {
    background: #4e2233;
}

.otp-status {
    min-height: 18px;
    margin-top: 8px;
    color: #70445a;
    font-size: 13px;
    line-height: 1.35;
    text-align: center;
}

.otp-status:empty {
    display: none;
}

.otp-modal {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(47, 32, 40, 0.58);
}

.otp-modal.hidden {
    display: none;
}

.otp-dialog {
    position: relative;
    width: min(100%, 360px);
    padding: 22px;
    border: 1px solid rgba(99, 45, 65, 0.16);
    border-radius: 18px;
    background: rgba(255, 249, 251, 0.98);
    box-shadow: 0 24px 60px rgba(47, 32, 40, 0.24);
}

.otp-dialog h3 {
    margin: 0 0 8px;
    color: #632d41;
    font-size: 20px;
    text-align: center;
}

.otp-dialog p {
    margin: 0 0 14px;
    color: #70445a;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
}

.otp-close {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    color: #632d41;
    box-shadow: none;
    font-size: 26px;
    line-height: 1;
}

.otp-digits {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.otp-input-wrap {
    position: relative;
}

.otp-technical-input {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    opacity: 0;
    caret-color: transparent;
}

.otp-digit {
    display: grid;
    place-items: center;
    height: 52px;
    padding: 0;
    border: 1px solid rgba(99, 45, 65, 0.18);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.82);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0;
    text-align: center;
}

.otp-input-wrap:focus-within .otp-digit {
    border-color: rgba(99, 45, 65, 0.3);
}

.otp-debug-code {
    margin-top: 12px;
    padding: 9px 10px;
    border: 1px solid rgba(99, 45, 65, 0.16);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.76);
    color: #632d41;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

.otp-error {
    min-height: 18px;
    margin-top: 10px;
    text-align: center;
}

.name-dialog input {
    width: 100%;
}

.name-dialog .message {
    text-align: center;
}

.client-login-page .phone-picker {
    grid-template-columns: minmax(0, 1fr);
}

.client-login-page .phone-country-display {
    border-color: rgba(99, 45, 65, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
    color: #632d41;
}

.portfolio-gallery {
    margin: 10px 0 0;
}

.portfolio-stage-wrap {
    position: relative;
}

.portfolio-stage {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 14px;
    background: rgba(255, 242, 245, 0.78);
    box-shadow: 0 10px 22px rgba(99, 45, 65, 0.1);
    cursor: zoom-in;
    overflow: hidden;
}

.portfolio-stage img {
    display: block;
    width: 100%;
    aspect-ratio: 1.75;
    object-fit: cover;
}

.portfolio-counter {
    position: absolute;
    right: 12px;
    bottom: 12px;
    min-width: 52px;
    padding: 6px 9px;
    border-radius: 10px;
    background: rgba(47, 32, 40, 0.68);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.portfolio-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 50%;
    background: rgba(99, 45, 65, 0.58);
    color: #fff;
    box-shadow: 0 10px 22px rgba(47, 32, 40, 0.18);
    transform: translateY(-50%);
}

.portfolio-nav:active:not(:disabled) {
    background: rgba(78, 34, 51, 0.9);
}

.portfolio-nav span {
    display: block;
    margin-top: -2px;
    font-size: 28px;
    line-height: 1;
}

.portfolio-prev {
    left: 10px;
}

.portfolio-next {
    right: 10px;
}

.portfolio-thumbs {
    display: grid;
    grid-auto-columns: 54px;
    grid-auto-flow: column;
    gap: 8px;
    margin-top: 7px;
    padding: 2px 1px 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
}

.portfolio-thumb {
    width: 54px;
    height: 54px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 12px;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    overflow: hidden;
}

.portfolio-thumb.active {
    border-color: #632d41;
}

.portfolio-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portfolio-lightbox {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 54px 18px 38px;
    background: rgba(24, 15, 20, 0.88);
}

.portfolio-lightbox.hidden {
    display: none;
}

.portfolio-lightbox img {
    display: block;
    width: min(100%, 860px);
    max-height: 78vh;
    border-radius: 14px;
    object-fit: contain;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.34);
}

.portfolio-lightbox-close,
.portfolio-lightbox-nav {
    position: fixed;
    z-index: 42;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.portfolio-lightbox-close:active:not(:disabled),
.portfolio-lightbox-nav:active:not(:disabled) {
    background: rgba(255, 255, 255, 0.25);
}

.portfolio-lightbox-close {
    top: 16px;
    right: 16px;
}

.portfolio-lightbox-close span {
    margin-top: -3px;
    font-size: 32px;
    line-height: 1;
}

.portfolio-lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
}

.portfolio-lightbox-nav span {
    margin-top: -3px;
    font-size: 34px;
    line-height: 1;
}

.portfolio-lightbox-prev {
    left: 16px;
}

.portfolio-lightbox-next {
    right: 16px;
}

.portfolio-lightbox-counter {
    position: fixed;
    left: 50%;
    bottom: 16px;
    padding: 7px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    transform: translateX(-50%);
}

@media (max-width: 380px) {
    .client-login-shell {
        padding: 12px 12px 22px;
    }

    .client-hero h1 {
        font-size: 27px;
    }

    .profile-avatar {
        width: 68px;
        height: 68px;
    }

    .client-hero {
        grid-template-columns: 68px minmax(0, 1fr);
        gap: 8px 12px;
    }

    .hero-subtitle,
    .hero-address {
        font-size: 12px;
    }

    .social-links {
        gap: 10px;
    }

    .portfolio-grid {
        gap: 6px;
    }

    .portfolio-stage img {
        aspect-ratio: 1.55;
    }

    .portfolio-nav {
        width: 34px;
        height: 34px;
    }

    .portfolio-thumbs {
        grid-auto-columns: 50px;
    }

    .portfolio-thumb {
        width: 50px;
        height: 50px;
    }

    .portfolio-lightbox-nav {
        width: 40px;
        height: 40px;
    }

}
