/* =========================================================
   MYFIT — SIGNUP PAGE
========================================================= */


/* ================= PAGE ================= */

.auth-page {
    min-height: calc(100vh - 80px);

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 50px 24px;

    background: var(--bg);
}


/* ================= CONTAINER ================= */

.auth-container {
    width: 100%;
    max-width: 1100px;

    display: grid;
    grid-template-columns: 1fr 1fr;

    background: var(--surface);

    border-radius: 24px;

    overflow: hidden;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}


/* ================= IMAGE ================= */

.auth-image {
    min-height: 680px;

    overflow: hidden;

    background: var(--primary);
}

.auth-image img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}


/* ================= FORM CONTAINER ================= */

.auth-form-container {
    padding: 55px 55px 45px;

    display: flex;
    flex-direction: column;
    justify-content: center;

    direction: rtl;
}


/* ================= HEADER ================= */

.auth-form-header {
    margin-bottom: 30px;
}

.auth-label {
    display: inline-block;

    margin-bottom: 10px;

    color: var(--accent);

    font-size: 13px;
    font-weight: 800;

    letter-spacing: 2px;
}

.auth-form-header h1 {
    margin: 0 0 10px;

    color: var(--text);

    font-size: clamp(26px, 3vw, 34px);
    font-weight: 800;

    line-height: 1.4;
}

.auth-form-header p {
    margin: 0;

    color: var(--muted);

    font-size: 14px;
    line-height: 1.8;
}


/* ================= FORM ================= */

.auth-form {
    width: 100%;
}

.form-group {
    margin-bottom: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 14px;
}


/* ================= LABEL ================= */

.form-group > label {
    display: block;

    margin-bottom: 8px;

    color: var(--text);

    font-size: 14px;
    font-weight: 700;
}


/* ================= INPUT ================= */

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;

    box-sizing: border-box;

    height: 48px;

    padding: 0 15px;

    border: 1px solid rgba(23, 33, 29, 0.12);

    border-radius: 12px;

    outline: none;

    background: var(--bg);

    color: var(--text);

    font-family: inherit;
    font-size: 14px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.auth-form input::placeholder {
    color: var(--muted);

    opacity: 0.8;
}

.auth-form input:focus {
    border-color: var(--accent);

    box-shadow: 0 0 0 3px rgba(155, 203, 85, 0.12);

    background: var(--surface);
}


/* ================= ROLE ================= */

.role-group {
    margin-top: 4px;
}

.role-options {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 12px;
}

.role-option {
    min-height: 50px;

    box-sizing: border-box;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 9px;

    padding: 10px 14px;

    border: 1px solid rgba(23, 33, 29, 0.12);

    border-radius: 12px;

    background: var(--bg);

    color: var(--text);

    cursor: pointer;

    font-size: 14px;
    font-weight: 600;

    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        color 0.2s ease;
}

.role-option:hover {
    border-color: var(--accent);
}

.role-option input {
    width: 16px;
    height: 16px;

    accent-color: var(--accent);

    cursor: pointer;
}

.role-option:has(input:checked) {
    border-color: var(--accent);

    background: var(--accent-light);

    color: var(--primary);
}


/* ================= PASSWORD ================= */

.password-field {
    position: relative;
}

.password-field input {
    padding-left: 48px !important;
}

.password-toggle {
    position: absolute;

    left: 10px;
    top: 50%;

    transform: translateY(-50%);

    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;

    background: transparent;

    color: var(--muted);

    cursor: pointer;

    font-size: 15px;
}

.password-toggle:hover {
    color: var(--accent);
}


/* ================= SUBMIT ================= */

.auth-submit {
    width: 100%;

    min-height: 50px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 10px;

    margin-top: 8px;

    border: 0;
    border-radius: 12px;

    background: var(--accent);

    color: var(--primary);

    font-family: inherit;

    font-size: 15px;
    font-weight: 800;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        opacity 0.2s ease,
        box-shadow 0.2s ease;
}

.auth-submit:hover {
    transform: translateY(-2px);

    opacity: 0.92;

    box-shadow: 0 8px 20px rgba(155, 203, 85, 0.2);
}

.auth-submit:active {
    transform: translateY(0);
}


/* ================= LOGIN LINK ================= */

.auth-switch {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    margin-top: 24px;

    color: var(--muted);

    font-size: 13px;
}

.auth-switch a {
    color: var(--accent);

    font-weight: 700;

    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}


/* ================= ERRORS ================= */

.form-errors {
    margin-bottom: 18px;

    padding: 12px 15px;

    border-radius: 10px;

    background: rgba(220, 70, 70, 0.08);

    color: #d45b5b;

    font-size: 13px;
}

.form-errors p {
    margin: 0;
}

.field-error {
    margin-top: 6px;

    color: #d45b5b;

    font-size: 12px;
    line-height: 1.6;
}

.errorlist {
    margin: 6px 0 0;
    padding: 0;

    list-style: none;

    color: #d45b5b;

    font-size: 12px;
}


/* =========================================================
   DARK MODE
========================================================= */

[data-theme="dark"] .auth-container {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.30);
}

[data-theme="dark"] .auth-form input[type="text"],
[data-theme="dark"] .auth-form input[type="email"],
[data-theme="dark"] .auth-form input[type="password"] {
    border-color: rgba(242, 245, 241, 0.10);

    background: #101412;

    color: #F2F5F1;
}

[data-theme="dark"] .auth-form input:focus {
    background: #18201C;
}

[data-theme="dark"] .role-option {
    border-color: rgba(242, 245, 241, 0.10);

    background: #101412;

    color: #F2F5F1;
}

[data-theme="dark"] .role-option:has(input:checked) {
    background: #557C2E;

    color: #F2F5F1;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 850px) {

    .auth-container {
        grid-template-columns: 1fr;
    }

    .auth-image {
        min-height: 360px;

        max-height: 420px;
    }

    .auth-form-container {
        padding: 45px 40px;
    }
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 560px) {

    .auth-page {
        min-height: auto;

        padding: 25px 15px 40px;
    }

    .auth-container {
        border-radius: 18px;
    }

    .auth-image {
        min-height: 240px;

        max-height: 280px;
    }

    .auth-form-container {
        padding: 32px 22px;
    }

    .auth-form-header {
        margin-bottom: 24px;
    }

    .auth-form-header h1 {
        font-size: 25px;
    }

    .form-row {
        grid-template-columns: 1fr;

        gap: 0;
    }

    .role-options {
        grid-template-columns: 1fr 1fr;

        gap: 8px;
    }

    .role-option {
        font-size: 13px;

        padding: 9px 8px;
    }
}
/* ================= ANIMATED BACKGROUND ================= */

/* ================= ANIMATED BACKGROUND ================= */

.auth-page {
    position: relative;
    overflow: hidden;
}

.auth-bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.35;
    z-index: 0;
    pointer-events: none;
}

.blob-1 {
    width: 380px;
    height: 380px;
    top: 5%;
    left: 5%;
    background: var(--accent);
    animation: float-1 22s ease-in-out infinite;
}

.blob-2 {
    width: 300px;
    height: 300px;
    top: 60%;
    left: 70%;
    background: var(--accent-light);
    animation: float-2 26s ease-in-out infinite;
}

.blob-3 {
    width: 220px;
    height: 220px;
    top: 15%;
    left: 60%;
    background: var(--accent);
    animation: float-3 19s ease-in-out infinite;
}

.blob-4 {
    width: 260px;
    height: 260px;
    top: 70%;
    left: 10%;
    background: var(--accent-light);
    animation: float-1 24s ease-in-out infinite reverse;
}

.blob-5 {
    width: 180px;
    height: 180px;
    top: 40%;
    left: 40%;
    background: var(--accent);
    animation: float-2 20s ease-in-out infinite reverse;
}


@keyframes float-1 {
    0%   { transform: translate(0, 0) scale(1); }
    25%  { transform: translate(40vw, 20vh) scale(1.15); }
    50%  { transform: translate(15vw, 55vh) scale(0.9); }
    75%  { transform: translate(-20vw, 25vh) scale(1.1); }
    100% { transform: translate(0, 0) scale(1); }
}

@keyframes float-2 {
    0%   { transform: translate(0, 0) scale(1); }
    30%  { transform: translate(-35vw, -30vh) scale(1.1); }
    60%  { transform: translate(-10vw, 15vh) scale(0.95); }
    100% { transform: translate(0, 0) scale(1); }
}

@keyframes float-3 {
    0%   { transform: translate(0, 0) scale(1); }
    20%  { transform: translate(-25vw, 40vh) scale(1.05); }
    50%  { transform: translate(20vw, 60vh) scale(1.2); }
    80%  { transform: translate(30vw, 10vh) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}

.auth-container {
    position: relative;
    z-index: 1;
}
.required-star {
    color: #557C2E;
    margin-right: 2px;
    font-weight: 700;
}

/* ================= PROFILE SETUP CARD (refined) ================= */

.profile-setup-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    background: var(--surface);
    border: 1px solid rgba(23, 33, 29, 0.06);
    border-radius: 26px;
    padding: 50px 46px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .profile-setup-card {
    border-color: rgba(242, 245, 241, 0.08);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
}

.profile-setup-card .auth-form-header {
    margin-bottom: 34px;
}

.profile-setup-card .auth-label {
    font-size: 13px;
    letter-spacing: 3px;
}

.profile-setup-card .auth-form-header h1 {
    font-size: clamp(24px, 3vw, 30px);
    margin-top: 6px;
}

.profile-setup-card .auth-form-header p {
    font-size: 15px;
    margin-top: 8px;
}

.profile-setup-card .auth-submit {
    min-height: 54px;
    font-size: 16px;
    margin-top: 12px;
}

@media (max-width: 560px) {
    .profile-setup-card {
        padding: 34px 24px;
        border-radius: 18px;
    }
}
/* ================= INPUT (improved) ================= */

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="number"],
.auth-form select,
.auth-form textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 52px;
    padding: 0 16px;
    border: 1.5px solid rgba(23, 33, 29, 0.12);
    border-radius: 12px;
    outline: none;
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-form textarea {
    padding: 14px 16px;
    min-height: 110px;
    resize: vertical;
    line-height: 1.7;
}

.auth-form input::placeholder,
.auth-form textarea::placeholder {
    color: var(--muted);
    opacity: 0.8;
    font-size: 14px;
}

.auth-form input:focus,
.auth-form select:focus,
.auth-form textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(155, 203, 85, 0.15);
    background: var(--surface);
}

/* remove ugly number spinner arrows */
.auth-form input[type="number"]::-webkit-inner-spin-button,
.auth-form input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.auth-form input[type="number"] {
    -moz-appearance: textfield;
}

/* bigger, clearer labels */
.form-group > label {
    display: block;
    margin-bottom: 10px;
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
}

.form-group {
    margin-bottom: 22px;
}


/* =========================================================
   DARK MODE — cover number/select/textarea too
========================================================= */

[data-theme="dark"] .auth-form input[type="text"],
[data-theme="dark"] .auth-form input[type="email"],
[data-theme="dark"] .auth-form input[type="password"],
[data-theme="dark"] .auth-form input[type="number"],
[data-theme="dark"] .auth-form select,
[data-theme="dark"] .auth-form textarea {
    border-color: rgba(242, 245, 241, 0.10);
    background: #101412;
    color: #F2F5F1;
}

[data-theme="dark"] .auth-form input:focus,
[data-theme="dark"] .auth-form select:focus,
[data-theme="dark"] .auth-form textarea:focus {
    background: #18201C;
}

/* ================= ENTRANCE ANIMATION ================= */

@keyframes card-rise {
    from {
        opacity: 0;
        transform: translateY(28px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes field-rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-setup-card {
    animation: card-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.profile-setup-card .auth-form-header {
    animation: field-rise 0.5s ease both;
    animation-delay: 0.1s;
}

.profile-setup-card .form-group {
    opacity: 0;
    animation: field-rise 0.5s ease both;
}

.profile-setup-card .form-group:nth-of-type(1) { animation-delay: 0.18s; }
.profile-setup-card .form-group:nth-of-type(2) { animation-delay: 0.24s; }
.profile-setup-card .form-group:nth-of-type(3) { animation-delay: 0.30s; }
.profile-setup-card .form-group:nth-of-type(4) { animation-delay: 0.36s; }
.profile-setup-card .form-group:nth-of-type(5) { animation-delay: 0.42s; }
.profile-setup-card .form-group:nth-of-type(6) { animation-delay: 0.48s; }

.profile-setup-card .auth-submit {
    opacity: 0;
    animation: field-rise 0.5s ease both;
    animation-delay: 0.56s;
}

/* subtle press feedback stays smooth alongside the entrance animation */
.profile-setup-card .auth-form input:focus,
.profile-setup-card .auth-form select:focus,
.profile-setup-card .auth-form textarea:focus {
    transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
    .profile-setup-card,
    .profile-setup-card .auth-form-header,
    .profile-setup-card .form-group,
    .profile-setup-card .auth-submit {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

.forgot-password-link {
    text-align: left;
    margin-top: -8px;
    margin-bottom: 20px;
}

.forgot-password-link a {
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.forgot-password-link a:hover {
    text-decoration: underline;
}