/* Skip link for screen readers */
.skip-link {
    position: absolute;
    top: -100%;
    left: -100%;
    background: #000;
    color: #fff;
    /* padding: 8px; */
    text-decoration: none;
    z-index: 1000;
    height: 1px;
    width: 1px;
    overflow: hidden;

    &:focus {
        top: 0;
        left: 0;
        height: 1px;
        width: 1px;
    }
}


/* main layout */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

body {
    display: flex;
    align-items: safe center;
    justify-content: safe center;
    padding: 1rem 0;
    margin: 0;

    @media (width < 768px) {
        padding: 0;
    }
}

:root {
    --rr-common-white: #ffffff;
    --rr-common-black: #000000;
    --rr-grey-1: #f2f4f9;
    --rr-grey-2: #203240;
    --rr-text-body: #636363;
    --rr-text-1: #777777;
    --rr-heading-1: #203240;
    --rr-theme-1: #0c346b;
    --rr-theme-2: #dd3936;
    /* #ed3237 */
    --rr-theme-3: #17212a;
    --rr-border-1: #ebebeb;
    --rr-background: #f5f5f5;
    --rr-accent: #ad513d;
    --background-start: var(--rr-theme-1);
    --background-end: var(--rr-theme-3);
}

html,
body {
    color: var(--rr-text-body);
    font-family: 'Inter', sans-serif;
    background-image: linear-gradient(var(--background-start), var(--background-end));
    min-height: 100dvh !important;
    height: auto !important;
}

body {
    display: flex;
    align-items: safe center;
    justify-content: safe center;
    padding: 2rem 0;
    margin: 0;

    @media (width < 768px) {
        padding: 0;
    }
}

.progress-steps-list {
    width: 100%;
    display: flex;
    list-style-type: none;
}

.feedback-container {
    width: 100%;
    max-width: min(768px, 100%);
    background: #fff;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.6s ease;
    margin: auto;
    min-height: if(media(width < 768px): inherit; else: fit-content);

    &:has(.success-container, #language-title) {
        min-height: fit-content;
    }

    &:has(#language-title, #patient-form, .success-container) {
        max-width: min(600px, 90%);
        margin-block: 1rem;
    }

    &:has(#feedbackForm, #patient-form) {
        border-radius: if(media(width < 768px): 0; else: 16px);
    }

    @media (width < 768px) {
        padding: 1rem;

        &:has(#patient-form) {
            max-width: min(600px, 100%);
            margin-block: 0;

            .page-header {
                margin-bottom: 1rem;

                >* {
                    margin-block: 0;
                }
            }

            .progress-steps {
                margin-block: 1.5rem;
            }

            #patient-form>.mb-4 {
                margin-bottom: 1.25rem !important;
            }
        }
    }

    &:has(#patient-form) {
        .page-header {
            margin-bottom: 1rem;

            >* {
                margin-block: 0;
            }
        }

        .progress-steps {
            margin-block: 1.5rem;
        }
    }
}

.brand-header {
    text-align: center;
    margin-bottom: 2rem;

    .logo-header {
        max-width: 150px;
        height: auto;
        margin-bottom: 1.5rem;
        display: block;
        margin-inline: auto;
    }

    h2 {
        color: var(--rr-theme-1);
        font-weight: 800;
        margin-bottom: 0.5rem;
        letter-spacing: -0.5px;
    }

    .subtitle {
        color: var(--rr-text-1);
        font-size: 0.95rem;
    }
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;

    &::before {
        content: '';
        position: absolute;
        top: 15px;
        inset-inline: 0;
        height: 2px;
        background: #e9ecef;
        z-index: 0;
    }
}

.progress-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;

    .step-circle {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: #e9ecef;
        color: #adb5bd;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
        transition: all 0.3s;
    }

    &.active .step-circle {
        background: var(--rr-theme-1);
        color: #fff;
        box-shadow: 0 0 0 4px rgba(12, 52, 107, 0.1);
    }

    &.completed .step-circle {
        background: var(--rr-theme-2);
        color: #fff;
    }

    .step-label {
        font-size: 0.75rem;
        color: var(--rr-text-1);
        display: block;
        margin-top: 4px;
    }

    &.active .step-label {
        color: var(--rr-theme-1);
        font-weight: 700;
    }
}

@media (max-width: 576px) {
    .progress-step .step-label {
        font-size: 0.65rem;
    }
}

.parsley-error-container {
    width: 100%;
}

.parsley-errors-list {

    :is(.col-md-4, .col-md-6, .col-12, .mb-3) & {
        order: 999;
    }

    padding: 0.5ch;
    margin-top: 0.25rem;
    list-style: none;
}

.ts-wrapper.parsley-error .ts-control {
    border-color: #d63939;
}



/* language selection */

@keyframes scaleHover {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.05);
    }
}

.language-card {
    position: relative;
    overflow: hidden;
    border: none;
    border-radius: 100vh;
    corner-shape: squircle;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);

    &:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    }

    &.english {
        background: linear-gradient(var(--background-end), var(--background-start));
    }

    &.gujarati {
        background: linear-gradient(var(--background-end), var(--background-start));
    }

    .flag {
        font-size: 3rem;
        margin-bottom: 1rem;
        display: block;
    }

    .lang-name {
        font-size: 1.75rem;
        font-weight: 700;
        color: #fff;
        margin: 0;
    }
}

.select-prompt {
    color: var(--rr-text-body);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

#language-title {
    color: var(--rr-heading-1);
    font-weight: 800;
}


/* patient-form */

.submit-btn {
    background: var(--rr-theme-1);
    border: none;
    border-radius: 8px;
    padding: 14px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    transition: all 0.3s;

    &:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(12, 52, 107, 0.2);
        background: var(--rr-theme-3);
    }
}

.page-header {
    margin-bottom: 2rem;

    h3 {
        color: var(--rr-heading-1);
        margin-bottom: 0.5rem;
        font-weight: 700;
    }

    .subtitle {
        color: var(--rr-text-1);
    }
}

.input-group-text {
    background-color: #f8f9fa;
    border-right: none;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
    border-left-color: #e9ecef;
}

.form-label {
    font-weight: 600;
    color: var(--rr-heading-1);
    margin-bottom: 0.5rem;
}


/* success */

@keyframes checkmarkAppear {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }

    50% {
        transform: scale(1.2) rotate(360deg);
    }

    100% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100vh);
        opacity: 0;
    }
}

.success-container {
    text-align: center;
    padding: 1rem 1rem 0rem;
}

.checkmark-circle {
    --size: if(media(width < 768px): 85px; else: 120px);
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: green;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    animation: checkmarkAppear 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 40px green;
}

.checkmark-icon {
    font-size: if(media(width < 768px): 2.9rem; else: 4rem);
    color: #fff;
    text-box-edge: cap alphabetic;
    text-box-trim: trim-both;
}

.success-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--rr-theme-1);
    margin-bottom: 1rem;
}

.success-subtitle {
    font-size: 1.5rem;
    color: #6c757d;
    margin-bottom: 2rem;
}

.success-message {
    font-size: 1.1rem;
    color: var(--rr-text-body);
    line-height: 1.8;
    max-width: 500px;
    margin: 0 auto 3rem;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    background: var(--rr-theme-1);
    color: #fff;
    padding: 1rem;
    border-radius: 100vh;
    corner-shape: squircle;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s;
    box-shadow: 0 6px 20px rgba(12, 52, 107, 0.2);

    &:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 24px rgba(12, 52, 107, 0.3);
        background: var(--rr-theme-3);
        color: #fff;
    }
}


/* question */

.page-header {
    margin-bottom: 2rem;

    h3 {
        color: var(--rr-heading-1);
        margin-bottom: 0.5rem;
        font-weight: 700;
    }
}

.question-card {
    background: #fff;
    border: 2px solid #f1f3f5;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s;

    &:hover {
        border-color: #dee2e6;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    @media (width < 768px) {
        padding: 1rem;

        h4 {
            margin: 0 !important
        }
    }
}

.question-number {
    display: inline-block;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    background: var(--rr-theme-1);
    color: #fff;
    border-radius: 100vh;
    corner-shape: squircle;
    font-weight: 700;
    margin-right: 0.75rem;
}

.range-container {
    margin-block: 0 !important
}

.range-wrapper {
    position: relative;
    margin-inline: 1rem;
    display: grid;
}

.range-ticks {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0;

    @media (width < 768px) {
        order: 2;
    }
}

.tick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* flex: 1; */

    &:last-child {
        margin-inline: -1px;
    }
}

.tick-number {
    font-size: 14px;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 2px;
}

.tick-line {
    width: 1px;
    height: 6px;
    background-color: #adb5bd;
}

.form-range.custom-range {
    --thumb-x: -1px;

    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    -webkit-appearance: none;
    width: fill-available;
    width: stretch;
    width: -ms-fill-available;
    width: -moz-available;
    width: -webkit-fill-available;
    display: block;
    margin: 0 -1rem;
    padding-inline: 10px;

    &::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 20px;
        height: 20px;
        background: var(--rr-theme-1);
        border: 3px solid #fff;
        border-radius: 50%;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
        cursor: pointer;
        transition: background 0.15s ease-in-out, transform 0.15s ease-in-out;
        margin-top: -13px;
        /* margin-inline: -1px; */
        transform: translateX(var(--thumb-x));

        @media (width < 768px) {
            width: 16px;
            height: 16px;
            border: 2px solid #fff;
            margin-top: -12px;
        }
    }

    &::-webkit-slider-runnable-track {
        width: 100%;
        height: 8px;
        cursor: pointer;
        background: transparent;
        border-radius: 4px;
    }

    &:focus::-webkit-slider-thumb {
        background: #764ba2;
        transform: scale(1.1);
        box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
    }

    &::-moz-range-thumb {
        width: 20px;
        height: 20px;
        background: #667eea;
        border: 3px solid #fff;
        border-radius: 50%;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
        cursor: pointer;
        transition: background 0.15s ease-in-out, transform 0.15s ease-in-out;
        transform: translateX(var(--thumb-x));

        @media (width < 768px) {
            width: 16px;
            height: 16px;
            border: 2px solid #fff;
            margin-top: -12px;
        }
    }

    &::-moz-range-track {
        width: 100%;
        height: 8px;
        cursor: pointer;
        background: #eee;
        border-radius: 4px;
    }

    &:focus::-moz-range-thumb {
        background: #764ba2;
        transform: scale(1.1);
        box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
    }

    @media (width < 768px) {
        order: 2;
    }
}

.range-labels {
    display: flex;
    justify-content: space-between;
    margin: 1.1rem -2rem 0;

    @media (width < 768px) {
        margin: 0.5rem -8px 0 -10px;
    }
}

.range-label-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    width: calc(100% / sibling-count());

    .text {
        font-size: 14px;
        color: #6c757d;
        line-height: 1.1;
        margin-top: 4px;

        @media (width < 768px) {
            writing-mode: horizontal-tb;
            margin-top: 0;
        }
    }

    @media (width < 768px) {
        display: none;
        order: 0;
        flex-direction: row;
        gap: 8px;
        justify-content: center;
        margin-block: -0.5ch 1rem;
        flex: 1;
        width: fit-content;

        border: 1px solid #80808020;
        flex: 0 1 auto;
        margin-inline: auto;
        padding: 0.5rem;
        border-radius: 6px;
        background: #6b6fd50a;

        &.active-item {
            display: flex;
        }
    }
}

.rating-icon {
    font-size: if(media(width < 768px): 12px; else: 1.5rem);
    margin-bottom: 0px;
    color: #ccc;
    transition: all 0.3s ease;

    &.active-icon {
        transform: scale(1.1);
    }

    @media (width < 768px) {
        font-size: 1.5rem !important;
        margin-bottom: 0px;
    }
}

.submit-btn {
    background: var(--rr-theme-1);
    border: none;
    border-radius: 1.5rem;
    corner-shape: squircle;
    padding: 16px 48px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    transition: all 0.3s;
    box-shadow: 0 6px 20px rgba(12, 52, 107, 0.2);

    &:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 24px rgba(12, 52, 107, 0.3);
        background: var(--rr-theme-3);
    }
}

.progress-text {
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}
