:root {
    --rukn-orange: #ff7a18;
    --rukn-gray: #f3f4f6;
    --muted: #6b7280;
    --rukn-orange-light: #fdba74;
}

body {
    font-family: 'Cairo',sans-serif;
    background: #F1F1F1;
    color: #111827;
}

.input-field {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: .25s;
}

    .input-field:focus {
        border-color: var(--rukn-orange);
        box-shadow: 0 0 0 3px rgba(255,122,24,.25);
        outline: none;
    }

.input-error {
    border-color: #ff4d4d !important;
    box-shadow: 0 0 0 3px rgba(255,0,0,.15) !important;
}

.field-error {
    color: #b20000;
    font-size: 13px;
    margin-top: 4px;
    margin-bottom: 10px;
    font-weight: 600;
}

.label {
    font-weight: 700;
    margin-bottom: 6px;
    display: block;
}

.toggle-active {
    background: var(--rukn-orange) !important;
    color: white !important;
}

.submit-btn {
    background: var(--rukn-orange);
    color: white;
    padding: 14px;
    font-size: 17px;
    border-radius: 8px;
    font-weight: 700;
    margin-top: 12px;
    transition: .3s;
    box-shadow: 0 5px 10px rgba(255,122,24,.25);
}

    .submit-btn:hover {
        transform: translateY(-2px);
        background: #e56a00;
    }

#mobileForm .submit-btn {
    width: 100%;
    margin-top: 20px;
}

.popup-bg {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 999;
}

    .popup-bg.hidden {
        display: none;
    }

.popup-box {
    background: white;
    width: 100%;
    max-width: 420px;
    padding: 32px 28px;
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(15,23,42,.12);
    position: relative;
    overflow: hidden;
    animation: pop .3s ease;
}

    /* Gradient bar on top, like auth card */
    .popup-box::before {
        content: "";
        position: absolute;
        inset: 0 0 auto;
        height: 4px;
        background: linear-gradient(90deg, var(--rukn-orange), var(--rukn-orange-light));
        opacity: .9;
    }

/* Inner scrolling area (smooth, clean look) */
.popup-content {
    max-height: 30vh;
    overflow-y: auto;
    padding-right: 6px;
    padding-left: 24px;
    text-align: justify;
    text-justify: inter-word;
    line-height: 2;
    margin-bottom: 24px;
}

    /* Elegant scrollbar */
    .popup-content::-webkit-scrollbar {
        width: 8px;
    }

    .popup-content::-webkit-scrollbar-thumb {
        background: var(--rukn-orange);
        border-radius: 10px;
    }

    .popup-content::-webkit-scrollbar-track {
        background: #ffe4d3; /* soft orange tint */
        border-radius: 10px;
    }

@keyframes pop {
    from {
        opacity: 0;
        transform: scale(.85) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.success-popup-bg {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

    .success-popup-bg.hidden {
        display: none;
    }
/* ===== Success Popup (same design as main container) ===== */
.success-popup {
    background: white;
    width: 100%;
    max-width: 420px;
    padding: 32px 28px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(15,23,42,.12);
    position: relative;
    overflow: hidden;
    animation: pop .35s ease;
}

    /* Gradient bar for success popup too */
    .success-popup::before {
        content: "";
        position: absolute;
        inset: 0 0 auto;
        height: 4px;
        background: linear-gradient(90deg, var(--rukn-orange), var(--rukn-orange-light));
        opacity: .9;
    }

#logoPreview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: transparent;
}

.card-shadow {
    box-shadow: 0 6px 18px rgba(20, 20, 30, 0.06);
}

.checkbox-large {
    width: 18px;
    height: 18px;
    accent-color: var(--rukn-orange);
    cursor: pointer;
    transform: scale(1.1);
}

.auth-card {
    background: white;
    border-radius: 24px;
    padding: 32px 28px;
    max-width: 420px;
    margin: 0 auto;
    box-shadow: 0 24px 60px rgba(15,23,42,.12);
    position: relative;
    overflow: hidden;
}

    .auth-card::before {
        content: "";
        position: absolute;
        inset: 0 0 auto;
        height: 4px;
        background: linear-gradient(90deg, var(--rukn-orange), #fdba74);
        opacity: .9;
    }

.auth-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    margin-bottom: 24px;
    margin-top: 4px;
}

.auth-logo {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(15,23,42,.1);
    font-weight: 800;
    font-size: 26px;
    color: var(--rukn-orange);
}

    .auth-logo img {
        max-width: 70%;
        max-height: 70%;
        object-fit: contain;
    }

.auth-title {
    font-size: 20px;
    font-weight: 800;
    color: #111827;
    letter-spacing: .02em;
}

.auth-subtitle {
    font-size: 12px;
    color: #6b7280;
}


#signupForm {
    border-top: 1px solid #f3f4f6;
    padding-top: 20px;
    margin-top: 20px;
}

/* ===== Page wrapper: card centred in the visible area ===== */
/* 66px = site header; bottom padding keeps the centre clear of the app-download bar */
.signup-page {
    min-height: calc(100vh - 66px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px 96px;
}

#signupContainer.auth-card {
    max-width: 460px;
    padding: 40px;
}

/* ===== Step 1: square dialogue ===== */
#signupContainer.is-type-step {
    min-height: 460px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

    #signupContainer.is-type-step .auth-header {
        gap: 6px;
        margin: 0 0 28px;
    }

.auth-logo-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 14px;
}

#signupContainer .auth-title {
    font-size: 22px;
}

#signupContainer .auth-subtitle {
    font-size: 13px;
}

/* ===== Step 1: account type cards (square) ===== */
.type-step-title {
    text-align: center;
    margin: 0 0 14px;
    font-size: 14px;
    color: #374151;
}

.type-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.type-card {
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 14px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 18px;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, transform .2s;
    text-align: center;
}

    .type-card:hover,
    .type-card:focus-visible {
        border-color: var(--rukn-orange);
        box-shadow: 0 10px 24px rgba(255,122,24,.14);
        transform: translateY(-2px);
        outline: none;
    }

.type-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #fff4ea;
    color: var(--rukn-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    transition: background .2s, color .2s;
}

    .type-card-icon svg {
        width: 28px;
        height: 28px;
    }

.type-card:hover .type-card-icon,
.type-card:focus-visible .type-card-icon {
    background: var(--rukn-orange);
    color: #fff;
}

.type-card-title {
    font-size: 17px;
    font-weight: 800;
    color: #111827;
}

.type-card-desc {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.6;
}

/* ===== Phones ===== */
@media (max-width: 480px) {
    .signup-page {
        align-items: flex-start;
        padding-top: 20px;
    }

    #signupContainer.auth-card {
        padding: 28px 20px;
    }

    #signupContainer.is-type-step {
        min-height: 0;
    }

    .type-cards {
        gap: 12px;
    }

    .type-card-icon {
        width: 48px;
        height: 48px;
    }

        .type-card-icon svg {
            width: 24px;
            height: 24px;
        }

    .type-card-desc {
        font-size: 11px;
    }
}

/* ===== Step 2: selected type chip (in the header, replaces the subtitle) ===== */
.type-chip {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #fff4ea;
    border-radius: 999px;
    font-size: 13px;
    color: #374151;
}

    .type-chip strong {
        color: var(--rukn-orange);
    }

.type-chip-sep {
    color: #d1d5db;
}

#signupContainer:not(.is-type-step) .type-chip {
    display: inline-flex;
}

#signupContainer:not(.is-type-step) .auth-subtitle {
    display: none;
}

#signupContainer:not(.is-type-step) .auth-header {
    margin-bottom: 0;
}

.type-change {
    color: var(--rukn-orange);
    font-weight: 700;
    font-size: 13px;
    text-decoration: underline;
}

.submit-btn:disabled {
    opacity: .6;
    cursor: wait;
    transform: none;
}

/* ===== Step 2: compact form ===== */
#signupContainer:not(.is-type-step) {
    padding: 28px 32px 32px;
}

    #signupContainer:not(.is-type-step) .auth-logo-wrap {
        margin-bottom: 6px;
    }

        #signupContainer:not(.is-type-step) .auth-logo-wrap img {
            height: 36px;
        }

    #signupContainer:not(.is-type-step) .auth-header {
        gap: 6px;
    }

    #signupContainer:not(.is-type-step) .auth-title {
        font-size: 19px;
    }

#signupContainer #signupForm {
    margin-top: 16px;
    padding-top: 16px;
}

    /* vertical rhythm: 14px between rows instead of 24px */
    #signupForm:not(.hidden) {
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

        #signupForm:not(.hidden) > * {
            margin-top: 0 !important;
            margin-bottom: 0 !important;
        }

        /* empty error holders must not add a gap */
        #signupForm:not(.hidden) > div:empty {
            display: none;
        }

    #signupForm .gap-6 {
        gap: 14px;
    }

    #signupForm .label {
        font-size: 13px;
        margin: 0 0 5px;
    }

    #signupForm .input-field {
        padding: 10px 12px;
        font-size: 14px;
        border-width: 1.5px;
        border-radius: 10px;
    }

    #signupForm .field-error {
        font-size: 12px;
        margin: 4px 0 0;
    }

    /* store section */
    #signupForm #storeBox {
        border-radius: 14px;
        box-shadow: none;
        border: 1px solid #fed7aa;
    }

        #signupForm #storeBox > div:first-child {
            padding: 8px 16px;
        }

            #signupForm #storeBox > div:first-child h3 {
                font-size: 14px;
            }

        #signupForm #storeBox > div:last-child {
            padding: 16px;
        }

            #signupForm #storeBox > div:last-child > * + * {
                margin-top: 14px;
            }

        #signupForm #storeBox .w-24 {
            width: 64px;
            height: 64px;
            border-radius: 16px;
        }

        #signupForm #storeBox #logoPlaceholder {
            font-size: 24px;
        }

    /* submit */
    #signupForm #registerBtn {
        padding: 12px;
        font-size: 16px;
        margin-top: 4px !important;
    }

@media (max-width: 480px) {
    #signupContainer:not(.is-type-step) {
        padding: 24px 18px 26px;
    }
}
