@font-face {
    font-family: "Aptos";
    src: url("../../fonts/Aptos.ttf") format("truetype");
}

@font-face {
    font-family: "Source Serif";
    src: url("../../fonts/SourceSerif4-VariableFont_opsz\,wght.ttf")
        format("truetype");
}

@font-face {
    font-family: "Geist Mono";
    src: url("../../fonts/GeistMono-VariableFont_wght.ttf") format("truetype");
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family:
        Aptos,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;
    background-color: #fff;
    min-height: 100vh;
}

/* ============================================
   LIQUID GLASS TOP BAR (AUTH PAGES)
   ============================================ */

.authGlassTopBar {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 600px;
    height: 72px;
    border-radius: 20px;
    z-index: 1000;
    cursor: grab;
    user-select: none;
    /* Purple tinted glass material */
    background: linear-gradient(
        135deg,
        rgba(145, 59, 159, 0.08) 0%,
        rgba(145, 59, 159, 0.04) 50%,
        rgba(145, 59, 159, 0.06) 100%
    );
    backdrop-filter: blur(12px) saturate(1.4);
    -webkit-backdrop-filter: blur(12px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        0 8px 32px rgba(52, 21, 57, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.06),
        inset 0 1px 1px rgba(255, 255, 255, 0.8),
        inset 0 -1px 1px rgba(0, 0, 0, 0.03);
}

.authGlassTopBar:active {
    cursor: grabbing;
}

.authGlassTopBar.dragging {
    cursor: grabbing;
    transition: box-shadow 0.15s ease;
    box-shadow:
        0 16px 48px rgba(52, 21, 57, 0.18),
        0 4px 12px rgba(0, 0, 0, 0.1),
        inset 0 1px 1px rgba(255, 255, 255, 0.9),
        inset 0 -1px 1px rgba(0, 0, 0, 0.05);
}

.authGlassTopBar.bouncing {
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.authGlassTopBarInner {
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 100%;
    position: relative;
    z-index: 2;
}

/* Glass highlight - specular reflection */
.authGlassHighlight {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    pointer-events: none;
    z-index: 1;
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.4) 0%,
            rgba(255, 255, 255, 0) 40%
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0) 100%
        );
}

/* Back Button - pill shape with icon and text */
.authTopBarBack {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 56px;
    padding: 0 20px 0 16px;
    background: #ece6f0;
    border: 1px solid transparent;
    border-radius: 28px;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    z-index: 3;
    text-decoration: none;
    transition:
        transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        background 0.3s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease;
}

.authTopBarBack:hover {
    background: rgba(236, 230, 240, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow:
        0 4px 16px rgba(52, 21, 57, 0.1),
        inset 0 1px 1px rgba(255, 255, 255, 0.6),
        inset 0 -1px 1px rgba(0, 0, 0, 0.05);
    transform: scale(1.04);
}

.authTopBarBack:active {
    animation: authLiquidBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes authLiquidBounce {
    0% {
        transform: scale(1);
    }
    20% {
        transform: scale(0.85) rotate(-3deg);
    }
    40% {
        transform: scale(1.12) rotate(2deg);
    }
    60% {
        transform: scale(0.95) rotate(-1deg);
    }
    80% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.authTopBarBack svg {
    width: 18px;
    height: 18px;
    color: #341539;
    flex-shrink: 0;
}

.authTopBarBackText {
    font-family: Aptos, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #913b9f;
}

.authTopBarTitle {
    flex: 1;
    text-align: center;
    font-family: "Geist Mono", "Courier New", Courier, monospace;
    font-size: 15px;
    font-weight: 600;
    color: #341539;
    position: relative;
    z-index: 3;
}

.authTopBarLogo {
    height: 28px;
    width: auto;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

.authTopBarSpacer {
    width: 90px;
}

/* No back button variant */
.authGlassTopBar.no-back .authTopBarTitle {
    text-align: center;
}

.authGlassTopBar.no-back .authTopBarSpacer {
    display: none;
}

@media (max-width: 600px) {
    .authGlassTopBar {
        top: 8px;
        width: calc(100% - 16px);
        height: 56px;
        border-radius: 16px;
    }

    .authTopBarBack {
        height: 40px;
        padding: 0 14px 0 10px;
        border-radius: 20px;
    }

    .authTopBarBack svg {
        width: 16px;
        height: 16px;
    }

    .authTopBarBackText {
        font-size: 13px;
    }

    .authTopBarSpacer {
        width: 70px;
    }

    .authTopBarLogo {
        height: 22px;
    }

    .authTopBarTitle {
        font-size: 14px;
    }
}

/* ============================================
   AUTH CONTAINER - CENTERED LAYOUT
   ============================================ */

.authContainer {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    background: #f4f1f6;
    padding-top: 104px;
    padding-bottom: 24px;
}

.authRight {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    width: 100%;
}

.authFormContainer {
    width: 100%;
    max-width: 420px;
}

/* ============================================
   AUTH HEADER
   ============================================ */

.authHeader {
    margin-bottom: 32px;
    text-align: center;
}

.authTitle {
    color: #341539;
    font-family: "Source Serif", Georgia, serif;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}

.authSubtitle {
    color: #595959;
    font-size: 16px;
}

/* ============================================
   FORM STYLES
   ============================================ */

.authForm {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.formGroup {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.formLabel {
    color: #341539;
    font-size: 14px;
    font-weight: 500;
}

.formInput {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-family: Aptos, sans-serif;
    font-size: 16px;
    color: #341539;
    background: #fff;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.formInput:focus {
    outline: none;
    border-color: #913b9f;
    box-shadow: 0 0 0 3px rgba(145, 59, 159, 0.1);
}

.formInput::placeholder {
    color: #a0a0a0;
}

.formInput.error {
    border-color: #eb001b;
}

.formInput.error:focus {
    box-shadow: 0 0 0 3px rgba(235, 0, 27, 0.1);
}

/* Password Input Wrapper */
.passwordInputWrapper {
    position: relative;
}

.passwordInputWrapper .formInput {
    padding-right: 48px;
}

.passwordToggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #595959;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.passwordToggle:hover {
    color: #341539;
}

.eyeIcon {
    width: 20px;
    height: 20px;
}

.eyeIcon.eyeClosed {
    display: none;
}

.passwordToggle.visible .eyeIcon.eyeOpen {
    display: none;
}

.passwordToggle.visible .eyeIcon.eyeClosed {
    display: block;
}

/* Form Error Messages */
.formError {
    color: #eb001b;
    font-size: 13px;
    min-height: 18px;
    display: none;
}

.formError.visible {
    display: block;
}

.formErrorGeneral {
    text-align: center;
    padding: 12px;
    background: rgba(235, 0, 27, 0.08);
    border-radius: 8px;
    margin-top: 8px;
}

/* ============================================
   INVALID CREDENTIALS NOTIFICATION (LIQUID GLASS)
   ============================================ */

.invalidCredentialsNotif {
    position: fixed;
    top: 110px;
    right: -450px;
    width: auto;
    max-width: calc(100vw - 32px);
    padding: 24px;
    background: rgba(200, 150, 210, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    border-radius: 24px;
    box-shadow:
        0 8px 32px rgba(52, 21, 57, 0.1),
        inset 0 1px 1px rgba(255, 255, 255, 0.6),
        inset 0 -1px 1px rgba(0, 0, 0, 0.05);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    transition:
        right 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.3s ease,
        transform 0.3s ease;
}

.invalidCredentialsNotif.visible {
    right: 16px;
}

.invalidCredentialsNotifClose {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #341539;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.invalidCredentialsNotifClose:hover {
    background: rgba(255, 255, 255, 0.6);
    color: #913b9f;
}

.invalidCredentialsNotifClose svg {
    width: 14px;
    height: 14px;
}

.invalidCredentialsImage {
    width: 350px;
    height: auto;
}

.invalidCredentialsHeader {
    font-family: "Source Serif", Georgia, serif;
    font-size: 28px;
    font-weight: 700;
    color: #341539;
    margin: 0;
}

.invalidCredentialsText {
    font-family: Aptos, sans-serif;
    font-size: 16px;
    color: #341539;
    margin: 0;
    line-height: 1.4;
    white-space: nowrap;
}

.invalidCredentialsCta {
    width: 100%;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #913b9f;
    border-radius: 10px;
    background: transparent;
    color: #913b9f;
    font-family: Aptos, sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    margin-top: 4px;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.invalidCredentialsCta:hover {
    background: #913b9f;
    color: #fff;
}

@media (max-width: 480px) {
    .invalidCredentialsNotif {
        width: calc(100vw - 32px);
        right: -100vw;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .invalidCredentialsNotif.visible {
        right: 16px;
    }

    .invalidCredentialsImage {
        width: 200px;
    }

    .invalidCredentialsText {
        white-space: normal;
    }
}

/* Form Options Row */
.formOptions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checkboxLabel {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #595959;
    font-size: 14px;
    user-select: none;
}

.checkboxLabel input[type="checkbox"] {
    display: none;
}

.checkboxCustom {
    width: 18px;
    height: 18px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    position: relative;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease;
}

.checkboxLabel input[type="checkbox"]:checked + .checkboxCustom {
    background-color: #913b9f;
    border-color: #913b9f;
}

.checkboxLabel input[type="checkbox"]:checked + .checkboxCustom::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forgotLink {
    color: #913b9f;
    font-size: 14px;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgotLink:hover {
    color: #7a2f87;
    text-decoration: underline;
}

/* ============================================
   AUTH BUTTON
   ============================================ */

.authButton {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 12px;
    background: #341539;
    color: #fff;
    font-family: Aptos, sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition:
        background-color 0.2s ease,
        transform 0.1s ease;
    position: relative;
    overflow: hidden;
}

.authButton:hover:not(:disabled) {
    background: #4a2150;
}

.authButton:active:not(:disabled) {
    transform: scale(0.98);
}

.authButton:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.authButton.loading .btnText {
    visibility: hidden;
}

.authButton.loading .btnLoader {
    display: block;
}

.btnLoader {
    display: none;
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   DIVIDER
   ============================================ */

.authDivider {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.authDivider::before,
.authDivider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.authDivider span {
    padding: 0 16px;
    color: #595959;
    font-size: 14px;
}

/* ============================================
   SOCIAL BUTTON
   ============================================ */

.socialButton {
    width: 100%;
    height: 52px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    color: #341539;
    font-family: Aptos, sans-serif;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease;
}

.socialButton:hover {
    border-color: #341539;
    background: #faf8fb;
}

/* ============================================
   AUTH FOOTER
   ============================================ */

.authFooter {
    text-align: center;
    margin-top: 24px;
    color: #595959;
    font-size: 14px;
}

.authLink {
    color: #913b9f;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.authLink:hover {
    color: #7a2f87;
    text-decoration: underline;
}

/* ============================================
   PASSWORD STRENGTH INDICATOR
   ============================================ */

.passwordStrength {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.strengthBar {
    flex: 1;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    transition: background-color 0.3s ease;
}

.strengthBar.weak {
    background: #eb001b;
}

.strengthBar.fair {
    background: #f5a623;
}

.strengthBar.good {
    background: #7cb342;
}

.strengthBar.strong {
    background: #2e7d32;
}

.strengthText {
    font-size: 12px;
    color: #595959;
    margin-top: 4px;
}

.strengthText.weak {
    color: #eb001b;
}

.strengthText.fair {
    color: #f5a623;
}

.strengthText.good {
    color: #7cb342;
}

.strengthText.strong {
    color: #2e7d32;
}

/* ============================================
   SUCCESS MESSAGE
   ============================================ */

.successMessage {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
    padding: 32px;
}

.successMessage.visible {
    display: flex;
}

.successIcon {
    width: 64px;
    height: 64px;
    background: #e8f5e9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.successIcon svg {
    width: 32px;
    height: 32px;
    color: #2e7d32;
}

.successTitle {
    color: #341539;
    font-family: "Source Serif", Georgia, serif;
    font-size: 24px;
    font-weight: 700;
}

.successText {
    color: #595959;
    font-size: 16px;
    line-height: 1.5;
}

/* ============================================
   USER TYPE SELECTION (REGISTER)
   ============================================ */

.userTypeSelection {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.userTypeOption {
    flex: 1;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    text-align: center;
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease;
}

.userTypeOption:hover {
    border-color: #913b9f;
}

.userTypeOption.selected {
    border-color: #913b9f;
    background: rgba(145, 59, 159, 0.05);
}

.userTypeOption input {
    display: none;
}

.userTypeIcon {
    width: 40px;
    height: 40px;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f1f6;
    border-radius: 50%;
}

.userTypeOption.selected .userTypeIcon {
    background: rgba(145, 59, 159, 0.15);
}

.userTypeName {
    color: #341539;
    font-size: 14px;
    font-weight: 600;
}

/* ============================================
   BACK TO LOGIN LINK
   ============================================ */

.backToLogin {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #595959;
    font-size: 14px;
    text-decoration: none;
    margin-bottom: 24px;
    transition: color 0.2s ease;
}

.backToLogin:hover {
    color: #341539;
}

.backToLogin svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 968px) {
    .authRight {
        padding: 32px 24px;
    }
}

@media (max-width: 480px) {
    .authRight {
        padding: 24px 16px;
    }

    .authTitle {
        font-size: 28px;
    }

    .formOptions {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .userTypeSelection {
        flex-direction: column;
    }
}
