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

:root {
    --slack-aubergine: #4A154B;
    --slack-blue: #1264A3;
    --slack-green: #2EB67D;
    --slack-yellow: #ECB22E;
    --slack-red: #E01E5A;
    --slack-highlight: #ECB22E;
    --text: #1D1C1D;
    --text-muted: #616061;
    --border: #DDDDDD;
    --radius: 4px;

    /* Legacy aliases */
    --sf-navy: var(--slack-aubergine);
    --sf-blue: var(--slack-blue);
    --sf-cyan: var(--slack-green);
    --sf-light-cyan: var(--slack-highlight);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    height: 100vh;
}

/* Split layout - full viewport */
.split {
    display: flex;
    height: 100%;
}

/* Left panel - branding & context */
.split-left {
    flex: 0 0 38%;
    background: #4A154B;
    color: white;
    display: flex;
    align-items: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
}

.split-left::before {
    display: none;
}

.split-left::after {
    display: none;
}

.left-content {
    position: relative;
    z-index: 1;
}

.logo-left {
    height: 76px;
    width: auto;
    margin-bottom: 48px;
}

.brand {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.5;
    margin-bottom: 24px;
}

.split-left h1 {
    font-size: clamp(32px, 3.2vw, 44px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
    letter-spacing: -0.03em;
}

.split-left h1 .highlight {
    color: var(--slack-yellow);
}

.subtitle {
    font-size: 16px;
    opacity: 0.7;
    line-height: 1.6;
    max-width: 360px;
}

.expect {
    margin-top: 48px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 32px;
}

.expect-item {
    display: flex;
    align-items: center;
    margin-bottom: 18px;
    font-size: 15px;
    font-weight: 400;
    opacity: 0.85;
}

.expect-item:last-child {
    margin-bottom: 0;
}

.expect-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 13px;
    font-weight: 700;
    margin-right: 16px;
    flex-shrink: 0;
}

/* Troubleshoot */
.troubleshoot {
    margin-top: 36px;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    position: relative;
    z-index: 1;
}

.troubleshoot-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 8px;
}

.troubleshoot-list {
    list-style: none;
}

.troubleshoot-list li {
    font-size: 14px;
    opacity: 0.85;
    line-height: 1.5;
    margin-bottom: 10px;
    padding-left: 16px;
    position: relative;
}

.troubleshoot-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    opacity: 0.6;
}

.troubleshoot-list li:last-child {
    margin-bottom: 0;
}

/* Right panel - THE FORM (dominant) */
.split-right {
    flex: 1;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 80px;
}

.invite-form {
    width: 100%;
    max-width: 540px;
}

.form-heading {
    font-size: 42px;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 40px;
    letter-spacing: -0.02em;
}

.logo-right {
    height: 28px;
    width: auto;
    margin-bottom: 36px;
    opacity: 0.7;
}

.input-group {
    margin-bottom: 28px;
}

.input-group label {
    display: block;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
    letter-spacing: 0;
}

.code-hint {
    text-transform: none;
    font-weight: 500;
    font-size: 13px;
    color: var(--slack-blue);
    letter-spacing: 0;
}

.input-group input {
    width: 100%;
    padding: 20px 22px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 20px;
    transition: all 0.2s ease;
    background: #fff;
}

.input-group input:focus {
    outline: none;
    border-color: var(--slack-blue);
    color: var(--text);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(18, 100, 163, 0.15);
}

.input-group input::placeholder {
    color: #b0b8c4;
}

.input-error {
    margin-top: 6px;
    font-size: 14px;
    color: #c23934;
    min-height: 18px;
    font-weight: 500;
}

/* Button */
.submit-btn {
    width: 100%;
    padding: 22px 32px;
    border: none;
    outline: none;
    color: white;
    background: var(--slack-aubergine);
    cursor: pointer;
    border-radius: 4px;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 72px;
    margin-top: 36px;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 8px rgba(74, 21, 75, 0.2);
    position: relative;
    letter-spacing: -0.01em;
}

.submit-btn:hover {
    background: #3d1040;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(74, 21, 75, 0.35);
}

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

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-text {
    transition: opacity 0.2s ease;
}

.loading-spinner {
    display: none;
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    position: absolute;
}

.submit-btn.loading .btn-text {
    opacity: 0;
}

.submit-btn.loading .loading-spinner {
    display: block;
}

.submit-btn.loading {
    background: var(--slack-aubergine);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Messages */
.message {
    display: none;
    width: 100%;
    max-width: 540px;
    padding: 20px 24px;
    border-radius: 12px;
    margin-top: 24px;
    font-size: 17px;
    line-height: 1.6;
    animation: messageAppear 0.4s ease forwards;
}

@keyframes messageAppear {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

.message.success {
    background: #e6f9ed;
    color: #14532d;
    border-left: 5px solid #2e844a;
    display: block;
    font-weight: 500;
}

/* Confirmation view - replaces form */
.message.confirm-view {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    display: block;
    text-align: center;
    max-width: 540px;
    width: 100%;
    color: var(--text);
}

.confirm-check {
    width: 72px;
    height: 72px;
    background: #2e844a;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
    margin: 0 auto 24px;
}

.confirm-title {
    font-size: 38px;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.confirm-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 36px;
    font-weight: 400;
}

.confirm-steps {
    text-align: left;
    background: #F8F8F8;
    border-radius: 4px;
    padding: 28px 32px;
    margin-bottom: 28px;
}

.confirm-step {
    display: flex;
    align-items: center;
    font-size: 17px;
    margin-bottom: 16px;
    color: var(--text);
}

.confirm-step:last-child {
    margin-bottom: 0;
}

.confirm-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: var(--slack-aubergine);
    color: white;
    font-size: 14px;
    font-weight: 700;
    margin-right: 16px;
    flex-shrink: 0;
}

.confirm-reset {
    background: none;
    border: 1.5px solid #d0d7e0;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.confirm-reset:hover {
    border-color: var(--slack-aubergine);
    color: var(--slack-aubergine);
}

.message.error {
    background: #fef0ef;
    color: #6b1e1e;
    border-left: 5px solid #c23934;
    display: block;
    font-weight: 500;
}

.message.info {
    background: #eaf6fe;
    color: #0c3357;
    border-left: 5px solid var(--sf-cyan);
    display: block;
    font-weight: 500;
}

/* ─── Salesforce theme overrides ─────────────────────────────── */
[data-theme="salesforce"] {
    --slack-aubergine: #032D60;
    --slack-blue: #0176D3;
    --slack-green: #00A1E0;
    --slack-yellow: #7dd3f8;
    --slack-highlight: #7dd3f8;
    --border: #d0d7e0;
}

[data-theme="salesforce"] .split-left {
    background: linear-gradient(160deg, #021B3D 0%, #032D60 40%, #0176D3 100%);
}

[data-theme="salesforce"] .input-group input {
    border-width: 2px;
    border-radius: 12px;
    background: #f9fafb;
}

[data-theme="salesforce"] .input-group input:focus {
    box-shadow: 0 0 0 4px rgba(1, 118, 211, 0.1);
}

[data-theme="salesforce"] .input-group label {
    color: #032D60;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

[data-theme="salesforce"] .form-heading,
[data-theme="salesforce"] .confirm-title {
    color: #032D60;
}

[data-theme="salesforce"] .submit-btn {
    border-radius: 16px;
    box-shadow: 0 6px 24px rgba(3, 45, 96, 0.2);
}

[data-theme="salesforce"] .submit-btn:hover {
    background: #0b4a7a;
    box-shadow: 0 10px 32px rgba(3, 45, 96, 0.3);
}

[data-theme="salesforce"] .confirm-num {
    border-radius: 50%;
    background: #0176D3;
}

[data-theme="salesforce"] .confirm-steps {
    background: #f4f7fa;
}

[data-theme="salesforce"] .confirm-reset:hover {
    border-color: #0176D3;
    color: #0176D3;
}

@keyframes pulse-glow-sf {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px rgba(245, 166, 35, 0.4); }
    50% { opacity: 0.4; box-shadow: 0 0 8px rgba(245, 166, 35, 0.8); }
}

/* Responsive */
@media (max-width: 900px) {
    .split {
        flex-direction: column;
    }

    html, body {
        overflow: auto;
        height: auto;
    }

    .split-left {
        flex: none;
        padding: 36px 24px;
    }

    .split-left h1 {
        font-size: 28px;
    }

    .expect {
        margin-top: 28px;
        padding-top: 20px;
    }

    .split-right {
        padding: 36px 24px;
    }

    .form-heading {
        font-size: 32px;
    }

    .input-group input {
        font-size: 17px;
        padding: 16px 18px;
    }

    .submit-btn {
        font-size: 18px;
        min-height: 60px;
    }
}
