﻿*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-from: #e2e5ee;
    --bg-to: #94a1bc;
    --card-bg: #ffffff;
    --card-radius: 12px;
    --card-shadow: 0 8px 40px rgba(60, 80, 110, 0.13), 0 1.5px 6px rgba(60, 80, 110, 0.07);
    --text-primary: #313849;
    --text-alt: #495165;
    --text-secondary: #696e82;
    --text-error: #aa332b;
    --text-label: #374055;
    --input-bg: #ffffff;
    --input-border: #dcdfe4;
    --input-border-focus: #5a6a8a;
    --input-radius: 8px;
    --accent: #5a6a8a;
    --accent-hover: #70809e;
    --accent-text: #ffffff;
    --link-color: #6985B8;
    --link-hover: #cf8826;
    --divider: #dcdfe4;
    --font-body: 'Nunito', sans-serif;
}

html {
    min-height: 100%;
    background: linear-gradient(0deg, var(--bg-from) 0%, var(--bg-to) 100%);
    font-size: 15px;
}

body {
    font-size: 15px;
    font-family: var(--font-body);
    min-height: 100vh;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    -webkit-font-smoothing: antialiased;
}

/* ── Logo ── */
.auth-logo {
    padding: 2rem 0 0;
    margin-bottom: auto;
    flex-shrink: 0;
}

    .auth-logo img {
        display: block;
        height: 48px;
        width: auto;
    }

/* ── Centered card area ── */
.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 2rem 1rem;
}

/* ── Card ── */
.card {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
}

.card-body {
    padding: 2.25rem 2.5rem 2rem;
}

/* ── Heading ── */
.card h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 1.75rem;
    letter-spacing: 0.05em;
}

/* ── Validation summary (erreurs générales) ── */
.alert-error {
    background: #fdf4f3;
    border: 1px solid #f9d2cf;
    border-radius: 7px;
    color: var(--text-error);
    padding: 0.65rem 0.9rem;
    margin-bottom: 1.25rem;
}

    .alert-error ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

/* ── Form ── */
.field {
    margin-bottom: 30px;
}

label {
    display: block;
    color: var(--text-label);
    margin-bottom: 6px;
    font-size: 1rem;
}

.input-wrap {
    position: relative;
}

input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    height: 42px;
    padding: 0 0.875rem 0 0.875rem;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: var(--input-radius);
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
    appearance: none;
}

    input[type="email"]:focus,
    input[type="password"]:focus,
    input[type="text"]:focus {
        border-color: var(--input-border-focus);
        border-width: 2px;
    }

input::placeholder {
    color: var(--text-secondary);
}

input#Code {
    text-align: center;
    font-size: 15.5px;
}

/* Error field */
input.input-validation-error {
    border-color: var(--text-error);
}

/* Message d'erreur sous le champ */
.field-error {
    color: var(--text-error);
    margin-top: 8px;
    display: block;   
}

.field-error:empty {
    display: none;
}

/* Toggle password visibility */
.toggle-pw {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}

    .toggle-pw:hover {
        color: var(--text-primary);
    }

    .toggle-pw svg {
        width: 18px;
        height: 18px;
        pointer-events: none;
    }

/* Forgot link */
.forgot {
    display: inline-block;
    margin-top: 8px;
    color: var(--link-color);
    text-decoration: underline;
    text-underline-offset: 2px;
}

    .forgot:hover {
        opacity: 0.7;
    }

/* ── Submit button ── */
.btn-submit {
    width: 100%;
    height: 44px;
    background: var(--accent);
    color: var(--accent-text);
    font-family: var(--font-body);
    font-size: 1rem;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: background 0.18s, transform 0.1s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 12px;
}

    .btn-submit:hover {
        background: var(--accent-hover);
    }

    .btn-submit:active {
        transform: scale(0.99);
    }

.btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    animation: spin 0.7s linear infinite;
    position: absolute;
    right: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-submit.loading .btn-spinner {
    display: block;
}

.btn-submit.loading .btn-text {
    opacity: 0.7;
}   

.spacer {
    height: 1px;
}

/* ── ConfirmEmail ── */
.confirm-email-intro {
    font-size: 15.5px;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 2.2rem;
    line-height: 1.5;
}

    .confirm-email-intro strong {
        color: var(--text-primary);
        font-weight: 700;
    }

.alert-success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 7px;
    color: #166534;
    font-size: 1rem;
    padding: 0.65rem 0.9rem;
    margin-bottom: 1.25rem;
}

/* ── Intro text (ForgotPassword, ConfirmEmail, etc.) ── */
.auth-intro {
    color: var(--text-primary);
    text-align: center;
    font-size: 15.5px;
    margin-bottom: 1.8rem;
}

/* ── Link button ── */
.btn-link {
    background: none;
    border: none;
    padding: 0;
    font-family: var(--font-body);
    font-size: inherit;
    color: var(--link-color);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.btn-link:hover {
    opacity: 0.7;
}

/* ── Terms and conditions ── */
.terms {
    color: var(--text-secondary);
    text-align: center;
    margin-top: 4px;
    margin-bottom: 24px;
    font-size: 15px;
}

.terms a {
    color: var(--link-color);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.terms a:hover {
    opacity: 0.7;
}

/* ── Card footer ── */
.card-footer {
    border-top: 1px solid var(--divider);
    padding: 1.5rem 2.5rem;
    text-align: center;
    font-size: 15.5px;
}

.card-footer p {
    color: var(--text-secondary);
}

.card-footer a {
    color: var(--link-color);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.card-footer a:hover {        
    opacity: 0.7;
}

.card-footer form {
    display: inline;
    font-weight: 400;
    color: var(--text-secondary);
}

/* ── Responsive ── */
@media (max-width: 540px) {
    .auth-logo {
        padding-top: 1.25rem;
    }

    .auth-logo img {
        height: 44px;
    }

    .card-body {
        padding: 1.75rem 1.25rem 1.5rem;
    }

    .card-footer {
        padding: 1.5rem 1.25rem;
    }

    .card {
        border-radius: 10px;
    }
}

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: #5b843a;
    color: #ffffff;
    font-weight: 500;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    white-space: normal;
    max-width: calc(100vw - 2rem);
    text-align: center;
    animation: toastIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both, toastOut 0.3s ease forwards 4s;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@media (max-width: 540px) {
    .toast {
        left: 1rem;
        right: 1rem;
        transform: none;
        width: auto;
        max-width: none;
    }

    @keyframes toastIn {
        from {
            opacity: 0;
            transform: translateY(12px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ── Checkout Success ── */
.success-body {
    text-align: center;
    padding: 2rem 2.5rem 2.05rem;
}

.success-icon {
    font-size: 3rem;
    color: #6e9b47;
    margin-bottom: 1rem;
}

.success-title {
    font-size: 2.5rem !important;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 1px !important;
    margin-bottom: 1.25rem !important;
}

.success-text {
    font-size: 1.2rem;
    color: var(--text-alt);
    line-height: 1.6;
    margin-bottom: 0;
}

.success-divider {
    height: 1px;
    background: var(--divider);
    margin: 2.5rem 0;
}

.success-next-title {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-alt);
    margin-bottom: 28px;
}

.success-next-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.5;
}

.refresh-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-top: -12px;
}

.success-account-link {
    color: var(--link-color);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s;
}

    .success-account-link:hover {
        color: var(--link-hover);
    }


/* ── Download buttons ── */
.download-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.75rem;
    border-radius: 12px;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    min-width: 235px;
}

.download-btn-windows {
    background: #4d5b7c;
    color: #ffffff;
}

    .download-btn-windows:hover {
        background: rgba(77,91,124,0.9);
        color: #ffffff;
    }

.download-btn-mac {
    background: var(--text-primary);
    color: #ffffff;
}

    .download-btn-mac:hover {
        /*background: rgba(49,56,73,0.97);*/
        background: var(--text-primary);
        color: #ffffff;
    }

.download-btn-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.download-btn-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    margin-right: 8px;
    font-family: var(--font-body);
}

.download-btn-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.download-btn-platform {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* ── Mac dropdown wrapper ── */
.mac-wrapper {
    position: relative;
}

.mac-trigger {
    width: 100%;
    cursor: pointer;
    border: none;
    transition: border-radius 0.15s;
}

.mac-chevron {
    margin-left: auto;
    font-size: 18px;
    opacity: 0.7;
    transition: transform 0.2s, opacity 0.2s;
}

/* Hover desktop */
.mac-wrapper:hover .mac-trigger,
.mac-wrapper.open .mac-trigger {
    border-radius: 12px 12px 0 0;
}

.mac-wrapper:hover .mac-chevron,
.mac-wrapper.open .mac-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

/* Dropdown */
.mac-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--text-primary);
    border-radius: 0 0 10px 10px;
    overflow: hidden;
    z-index: 100;
}

.mac-wrapper:hover .mac-dropdown,
.mac-wrapper.open .mac-dropdown {
    display: block;
}

/* Options */
.mac-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.15s;
}

    .mac-option:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
    }

.mac-option-chip {
    margin: -8px 0 -8px auto;
    font-size: 14px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(100, 220, 150, 0.2);
    color: #7ee8a8;
    white-space: nowrap;
}

@media (max-width: 650px) {

    .download-buttons {
        flex-direction: column;
        align-items: center;
    }

    .download-btn, .mac-wrapper {
        width: 100%;
        max-width: 300px;
    }

    .mac-chevron {
        margin-left: auto;
    }
}

@media (max-width: 540px) {
    .success-body {
        padding: 1.75rem 1.25rem 1.5rem;
    }
}
