﻿@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
    --navy: #111827;
    --slate: #6B7280;
    --slate-light: #9CA3AF;
    --gold: #C8A75C;
    --teal: #2BA6A6;
    --teal-light: #3BBFBF;
    --red: #DC2626;
    --border: #E5E7EB;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

.register-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse at 80% 80%, rgba(200, 167, 92, 0.15) 0%, transparent 50%), linear-gradient(135deg, #0a0a0a 0%, #111111 40%, #1a1a1a 70%, #0d0d0d 100%);
}

.auth-language-switch {
    position: absolute;
    top: 24px;
    right: 28px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,.72);
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.language-switch-link {
    color: rgba(255,255,255,.72);
    text-decoration: none;
    padding: 4px 2px;
}

.language-switch-link:hover,
.language-switch-link.is-active {
    color: #fff;
    text-decoration: none;
}

.language-switch-sep {
    color: rgba(255,255,255,.32);
}

    .register-container::before {
        content: '';
        position: absolute;
        top: -20%;
        right: -15%;
        width: 700px;
        height: 700px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(200, 167, 92, 0.08) 0%, transparent 65%);
        animation: floatOrb1 12s ease-in-out infinite;
        pointer-events: none;
    }

    .register-container::after {
        content: '';
        position: absolute;
        bottom: -25%;
        left: -10%;
        width: 600px;
        height: 600px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(200, 167, 92, 0.15) 0%, transparent 65%);
        animation: floatOrb2 15s ease-in-out infinite;
        pointer-events: none;
    }

@keyframes floatOrb1 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(-30px, 40px) scale(1.08);
    }
}

@keyframes floatOrb2 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(40px, -30px) scale(1.05);
    }
}

/* ─── Wrapper ───────────────────────────────────────── */
.register-wrapper {
    width: 100%;
    max-width: 580px;
    position: relative;
    z-index: 10;
    padding: 1.5rem;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ─── Card ──────────────────────────────────────────── */
.register-card {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem 2.5rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255,255,255,0.1);
    position: relative;
    animation: slideUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    overflow-y: auto;
    max-height: calc(100vh - 3rem);
    scrollbar-width: thin;
    scrollbar-color: rgba(26, 43, 73, 0.35) rgba(229, 231, 235, 0.85);
    scrollbar-gutter: stable;
}

    .register-card::-webkit-scrollbar {
        width: 10px;
    }

    .register-card::-webkit-scrollbar-track {
        background: rgba(229, 231, 235, 0.85);
        border-radius: 999px;
    }

    .register-card::-webkit-scrollbar-thumb {
        background: rgba(26, 43, 73, 0.35);
        border-radius: 999px;
        border: 2px solid rgba(229, 231, 235, 0.85);
    }

    .register-card::-webkit-scrollbar-thumb:hover {
        background: rgba(26, 43, 73, 0.55);
    }

    .register-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        border-radius: 20px 20px 0 0;
        background: linear-gradient(90deg, var(--gold) 0%, var(--teal) 60%, var(--gold) 100%);
        background-size: 200% 100%;
        animation: shimmer 3s ease-in-out infinite;
    }

@keyframes shimmer {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.98);
    }

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

/* ─── Header ────────────────────────────────────────── */
.register-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.brand-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -2px;
    color: #111827;
    margin: 0 0 0.2rem;
    line-height: 1;
}

.subtitle {
    color: var(--slate);
    font-size: 0.9rem;
    margin: 0;
}

/* ─── Form ──────────────────────────────────────────── */
.form-group {
    margin-bottom: 0.875rem;
}

.form-label {
    display: block;
    color: #111827;
    font-weight: 600;
    font-size: 0.82rem;
    margin-bottom: 0.35rem;
    letter-spacing: 0.3px;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    background: #FAFAFA;
    color: #111827;
}

    .form-input:focus {
        border-color: var(--teal);
        box-shadow: 0 0 0 3px rgba(43, 166, 166, 0.12);
        background: white;
    }

    .form-input:hover:not(:focus) {
        border-color: #C4C9D4;
    }

    .form-input[readonly] {
        background: #F0F1F3;
        color: #4B5563;
        cursor: default;
    }

        .form-input[readonly]:focus {
            box-shadow: none;
            border-color: var(--border);
        }

.form-hint {
    margin-top: 0.25rem;
    font-size: 0.72rem;
    color: var(--slate-light);
}

/* ─── Phone prefix ──────────────────────────────────── */
.phone-prefix {
    padding: 0.75rem 0.875rem;
    background: #F3F4F6;
    border: 1.5px solid var(--border);
    border-right: none;
    border-radius: 10px 0 0 10px;
    color: var(--slate);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    font-weight: 500;
    flex-shrink: 0;
}

/* ─── Password toggle ───────────────────────────────── */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

    .input-wrapper .form-input {
        padding-right: 3rem;
    }

.toggle-password {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    color: var(--slate-light);
    transition: color 0.2s ease;
}

    .toggle-password:hover {
        color: var(--navy);
    }

    .toggle-password svg {
        width: 17px;
        height: 17px;
        pointer-events: none;
    }

/* ─── Checkbox / Terms ──────────────────────────────── */
.terms-section {
    margin-bottom: 1rem;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
}

    .checkbox-container input[type="checkbox"] {
        margin-top: 0.15rem;
        width: 16px;
        height: 16px;
        cursor: pointer;
        flex-shrink: 0;
        accent-color: var(--teal);
    }

.checkbox-label {
    color: var(--slate);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    margin: 0;
    user-select: none;
}

.link-inline {
    color: var(--teal);
    text-decoration: none;
    font-weight: 600;
}

    .link-inline:hover {
        color: var(--teal-light);
    }

/* ─── Button ────────────────────────────────────────── */
.button-wrapper {
    margin-bottom: 0;
}

.btn, .btn-primary {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 18px rgba(26, 43, 73, 0.35);
}

    .btn:hover, .btn-primary:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 8px 28px rgba(26, 43, 73, 0.45);
    }

    .btn:active, .btn-primary:active {
        transform: translateY(0);
    }

    .btn-primary:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

/* ─── Divider ───────────────────────────────────────── */
.divider {
    position: relative;
    text-align: center;
    margin: 1rem 0;
}

    .divider::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 0;
        right: 0;
        height: 1px;
        background: var(--border);
    }

    .divider span {
        position: relative;
        background: white;
        padding: 0 1rem;
        color: var(--slate-light);
        font-size: 0.8rem;
    }

/* ─── Footer links ──────────────────────────────────── */
.footer-links {
    text-align: center;
    margin-top: 1rem;
}

    .footer-links p {
        color: var(--slate);
        font-size: 0.85rem;
        margin: 0;
    }

.link {
    color: var(--teal);
    text-decoration: none;
    font-weight: 600;
}

    .link:hover {
        color: var(--teal-light);
    }

/* ─── Validation ────────────────────────────────────── */
.validation-message {
    display: block;
    color: var(--red);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

.error-message {
    color: var(--red);
    font-weight: 500;
    padding: 0.75rem 1rem;
    background: rgba(220, 38, 38, 0.07);
    border-radius: 10px;
    border-left: 3px solid var(--red);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* ─── Responsive ────────────────────────────────────── */
@media (max-width: 540px) {
    html, body {
        overflow: auto;
        height: auto;
    }

    .register-container {
        height: auto;
        min-height: 100vh;
        align-items: flex-start;
        overflow: visible;
    }

    .register-wrapper {
        padding: 1rem;
        max-height: none;
    }

    .register-card {
        padding: 1.5rem 1.25rem;
        max-height: none;
        overflow-y: visible;
        border-radius: 16px;
    }

    .brand-title {
        font-size: 1.8rem;
    }
}

/* ═══════════════════════════════════════════════════════════
   STEP SYSTEM
═══════════════════════════════════════════════════════════ */
.reg-step {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: center;
}

.reg-step--active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-8px); }
}

/* ═══════════════════════════════════════════════════════════
   ROLE PICKER
═══════════════════════════════════════════════════════════ */
.role-picker {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    margin-top: .25rem;
}

.role-card {
    display: flex;
    align-items: center;
    gap: .9rem;
    width: 100%;
    padding: .875rem 1rem;
    background: #F9FAFB;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
    font-family: 'Inter', sans-serif;
}

.role-card:hover {
    border-color: var(--teal);
    background: rgba(43, 166, 166, .05);
    box-shadow: 0 2px 12px rgba(43, 166, 166, .12);
    transform: translateY(-1px);
}

.role-card:active {
    transform: translateY(0);
}

.role-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(26,43,73,.08) 0%, rgba(43,166,166,.12) 100%);
    color: var(--teal);
    flex-shrink: 0;
}

.role-card__icon svg {
    width: 20px;
    height: 20px;
}

.role-card__body {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    flex: 1;
    min-width: 0;
}

.role-card__title {
    font-family: 'Outfit', sans-serif;
    font-size: .95rem;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: -.2px;
}

.role-card__desc {
    font-size: .78rem;
    color: var(--slate);
    line-height: 1.4;
}

.role-card__arrow {
    color: var(--slate-light);
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: color .18s ease, transform .18s ease;
}

.role-card__arrow svg {
    width: 16px;
    height: 16px;
}

.role-card:hover .role-card__arrow {
    color: var(--teal);
    transform: translateX(2px);
}

/* ═══════════════════════════════════════════════════════════
   FORM STEP HEADER (back + role badge)
═══════════════════════════════════════════════════════════ */
.reg-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.reg-back-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: none;
    border: none;
    padding: .3rem .1rem;
    font-family: 'Inter', sans-serif;
    font-size: .82rem;
    font-weight: 600;
    color: var(--slate);
    cursor: pointer;
    transition: color .15s ease;
}

.reg-back-btn:hover {
    color: var(--navy);
}

.role-badge {
    display: inline-block;
    padding: .25rem .75rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(43,166,166,.12) 0%, rgba(26,43,73,.08) 100%);
    border: 1px solid rgba(43,166,166,.3);
    font-size: .75rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    color: var(--teal);
    letter-spacing: .3px;
    text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════
   INVITATION BANNER (register reached from /invite/{token})
═══════════════════════════════════════════════════════════ */
.reg-invite-banner {
    padding: .7rem .85rem;
    margin-bottom: 1rem;
    border-radius: .5rem;
    background: rgba(43,166,166,.08);
    border: 1px solid rgba(43,166,166,.28);
    font-family: 'Inter', sans-serif;
    font-size: .82rem;
    line-height: 1.45;
    color: var(--navy);
}

.reg-invite-banner--warn {
    background: rgba(217,119,6,.08);
    border-color: rgba(217,119,6,.3);
    color: #92400e;
}

/* ═══════════════════════════════════════════════════════════
   CONFIRMATION / EMAIL VERIFY SCREEN
═══════════════════════════════════════════════════════════ */
.confirm-card {
    text-align: center;
    padding: 2.5rem 2rem;
}

.confirm-icon-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.confirm-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(43,166,166,.15) 0%, rgba(26,43,73,.08) 100%);
    border: 2px solid rgba(43,166,166,.25);
    color: var(--teal);
    animation: iconPop .45s cubic-bezier(.22,1,.36,1) forwards;
}

.confirm-icon svg {
    width: 32px;
    height: 32px;
}

.confirm-icon--success {
    background: linear-gradient(135deg, rgba(16,185,129,.15) 0%, rgba(16,185,129,.05) 100%);
    border-color: rgba(16,185,129,.3);
    color: #10b981;
}

.confirm-icon--error {
    background: linear-gradient(135deg, rgba(220,38,38,.12) 0%, rgba(220,38,38,.04) 100%);
    border-color: rgba(220,38,38,.25);
    color: var(--red);
}

@keyframes iconPop {
    0%   { transform: scale(.6); opacity: 0; }
    70%  { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); }
}

.confirm-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: -.5px;
    margin: 0 0 .5rem;
}

.confirm-desc {
    color: var(--slate);
    font-size: .88rem;
    line-height: 1.55;
    margin: 0;
}

.confirm-email {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy);
    margin: .25rem 0 0;
    word-break: break-all;
}

.confirm-body {
    margin-bottom: .25rem;
}

.confirm-resent-msg {
    margin-top: .75rem;
    padding: .6rem .9rem;
    border-radius: 8px;
    font-size: .82rem;
    font-weight: 500;
}

.resent-ok {
    background: rgba(16,185,129,.08);
    border: 1px solid rgba(16,185,129,.25);
    color: #065f46;
}

.resent-err {
    background: rgba(220,38,38,.07);
    border: 1px solid rgba(220,38,38,.2);
    color: #991b1b;
}

.btn-resend {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    padding: .75rem 1rem;
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: .88rem;
    font-weight: 600;
    color: var(--navy);
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.btn-resend:hover:not(:disabled) {
    border-color: var(--teal);
    background: rgba(43,166,166,.05);
    color: var(--teal);
}

.btn-resend:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.confirm-divider {
    height: 1px;
    background: var(--border);
    margin: 1.1rem 0;
}

.btn-back-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    width: 100%;
    padding: .65rem 1rem;
    background: none;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: .85rem;
    font-weight: 600;
    color: var(--slate);
    cursor: pointer;
    text-decoration: none;
    transition: color .15s ease;
}

.btn-back-login:hover {
    color: var(--navy);
}

.confirm-spam-note {
    margin-top: 1rem;
    font-size: .75rem;
    color: var(--slate-light);
    line-height: 1.5;
}

@media (max-width: 540px) {
    .confirm-card {
        padding: 2rem 1.25rem;
    }

    .confirm-icon {
        width: 60px;
        height: 60px;
    }

    .confirm-icon svg {
        width: 26px;
        height: 26px;
    }
}
