﻿/* Collablly Portal login - matches staging auth layout */
:root {
    --tc-primary: #003b59;
    --tc-secondary: #38ad87;
    --tc-page-bg: #dbeafe;
    --tc-navy: #003b59;
    --tc-teal: #38ad87;
    --tc-muted: #6b7280;
    --tc-text: #000817;
    --tc-link: #38ad87;
    --tc-border: #e5e7eb;
    --tc-login-card-width: 400px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--tc-page-bg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.tc-login-page {
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    background: linear-gradient(to right, #ffffff 0%, #dbeafe 100%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--tc-text);
    padding: 32px 48px 32px 32px;
}

.tc-login-shell {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
}

.tc-login-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: clamp(40px, 6vw, 100px);
    width: 100%;
}

/* Left brand */
.tc-login-brand {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    padding-right: 16px;
    position: relative;
    min-height: 320px;
}

.tc-login-tool-scene {
    position: absolute;
    inset: -24px -16px;
    pointer-events: none;
    z-index: 0;
    overflow: visible;
}

.tc-tool-float {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tc-primary);
    opacity: 0.14;
    will-change: transform;
}

.tc-tool-float svg {
    width: 100%;
    height: 100%;
    display: block;
}

.tc-tool-float--1 {
    width: 42px;
    height: 42px;
    top: 8%;
    left: 6%;
    color: #003b59;
    animation: tcToolDriftA 11s ease-in-out infinite;
}

.tc-tool-float--2 {
    width: 36px;
    height: 36px;
    top: 18%;
    right: 8%;
    color: #38ad87;
    animation: tcToolDriftB 13s ease-in-out infinite;
    animation-delay: -2s;
}

.tc-tool-float--3 {
    width: 34px;
    height: 34px;
    bottom: 22%;
    left: 10%;
    color: #0c5c68;
    animation: tcToolDriftC 12s ease-in-out infinite;
    animation-delay: -4s;
}

.tc-tool-float--4 {
    width: 40px;
    height: 40px;
    bottom: 10%;
    right: 12%;
    color: #003b59;
    animation: tcToolDriftB 14s ease-in-out infinite;
    animation-delay: -6s;
}

.tc-tool-float--5 {
    width: 32px;
    height: 32px;
    top: 44%;
    left: 2%;
    color: #38ad87;
    animation: tcToolDriftA 10s ease-in-out infinite;
    animation-delay: -3s;
}

.tc-tool-float--6 {
    width: 38px;
    height: 38px;
    top: 52%;
    right: 4%;
    color: #0c5c68;
    animation: tcToolDriftC 15s ease-in-out infinite;
    animation-delay: -7s;
}

@keyframes tcToolDriftA {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
    50% { transform: translate3d(6px, -10px, 0) rotate(4deg); }
}

@keyframes tcToolDriftB {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
    50% { transform: translate3d(-8px, 8px, 0) rotate(-5deg); }
}

@keyframes tcToolDriftC {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
    50% { transform: translate3d(5px, 6px, 0) rotate(3deg); }
}

.tc-portal-brand-lockup {
    position: relative;
    z-index: 1;
    text-align: center;
}

.tc-portal-brand-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 17px;
}

.tc-portal-logo {
    height: 34px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.tc-portal-separator {
    width: 2px;
    height: 34px;
    background: #0c5c68;
    display: inline-block;
    flex-shrink: 0;
}

.tc-portal-title {
    font-size: 28px;
    font-weight: 400;
    color: #4caf93;
    letter-spacing: -0.04em;
    line-height: 1;
    font-family: 'Inter', sans-serif;
}

.tc-portal-brand-lockup p {
    margin: 7px 0 0 13px;
    color: #111111;
    font-size: 11px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

/* Right login card */
.tc-login-card-wrap {
    flex: 0 0 var(--tc-login-card-width);
    min-width: var(--tc-login-card-width);
    max-width: var(--tc-login-card-width);
    width: var(--tc-login-card-width);
    margin-left: auto;
    display: flex;
    justify-content: stretch;
    align-items: stretch;
    background: transparent;
}

.tc-login-card-wrap > form {
    width: 100%;
    min-width: 100%;
    margin: 0;
    flex: 1 1 100%;
}

.tc-login-card {
    width: 100%;
    min-width: 100%;
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #000817;
}

.tc-login-card h2 {
    text-align: center;
    font-size: 32px;
    font-weight: 600;
    color: #000817;
    margin: 0 0 4px;
    letter-spacing: -0.02em;
    line-height: 1.15;
    font-family: 'Inter', sans-serif;
}

.tc-login-card-sub {
    text-align: center;
    font-size: 14px;
    font-weight: 400;
    color: #000817;
    line-height: 1.2;
    margin: 0 0 48px;
    font-family: 'Inter', sans-serif;
}

.tc-login-field {
    margin-bottom: 12px;
}

.tc-login-field label {
    display: block;
    font-size: 14px;
    font-weight: 400;
    color: #06111f;
    margin-bottom: 4px;
    font-family: 'Inter', sans-serif;
}

.tc-login-field label span {
    color: #d73b3e;
}

.tc-login-field input[type="text"],
.tc-login-field input[type="password"],
.tc-login-field input[type="email"],
.tc-login-field .inputField,
.tc-login-pwd-wrap .inputField,
.tc-login-card .sign-in-panel .inputField {
    width: 100%;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #cfd3d7;
    border-radius: 0;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: #222222;
    background: #fff;
    margin-bottom: 0;
}

.tc-login-field input::placeholder,
.tc-login-field .inputField::placeholder {
    color: #a4a8ae;
}

.tc-login-field input:focus,
.tc-login-field .inputField:focus {
    outline: none;
    border-color: #9db6c5;
    box-shadow: none;
}

.tc-login-pwd-wrap { position: relative; }

.tc-login-pwd-wrap .inputField { padding-right: 36px; }

.tc-login-pwd-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #8c8c8c;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.tc-login-row-forgot {
    display: flex;
    justify-content: flex-end;
    margin: -6px 0 16px;
}

.tc-login-forgot {
    font-size: 12px;
    color: #38ad87;
    text-decoration: underline;
    font-weight: 400;
    font-family: 'Inter', sans-serif;
}

.tc-login-forgot:hover { color: #2d9a78; }

/* Captcha */
.tc-captcha-box {
    margin-bottom: 16px;
}

.tc-captcha-box.error .tc-captcha-code,
.tc-captcha-box.error + .tc-login-field .inputField {
    border-color: #ff4d4f;
    background-color: #fff2f0;
}

.tc-captcha-code {
    width: 100%;
    min-height: 48px;
    padding: 4px 8px;
    border-radius: 3px;
    background: var(--tc-page-bg);
    color: var(--tc-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 10px;
    font-family: "Courier New", monospace;
    user-select: none;
    padding-left: 10px;
    cursor: pointer;
}

.tc-captcha-refresh {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 7px 0 0 auto;
    border: none;
    background: transparent;
    color: #07111f;
    font-size: 10px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    padding: 0;
}

.tc-captcha-refresh span {
    width: 17px;
    height: 17px;
    border: 1px solid #35b997;
    color: #19ad8c;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    line-height: 1;
}

.tc-login-submit {
    width: 100%;
    height: 32px;
    border: none;
    border-radius: 4px;
    background: #003b59;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    margin-top: 1px;
}

.tc-login-submit:hover { background: #003d51; }

.tc-login-powered {
    text-align: center;
    margin-top: 13px;
    font-size: 12px;
    color: #3a2b35;
    font-family: 'Inter', sans-serif;
}

/* Forgot password page */
.tc-forgot-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 12px;
    color: var(--tc-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tc-forgot-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.tc-login-card-sub--compact {
    margin-bottom: 24px;
}

.tc-forgot-msg {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    color: #06111f;
    font-family: 'Inter', sans-serif;
}

.tc-login-alert-box.tc-forgot-msg--success {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.tc-login-alert-box.tc-forgot-msg--success .tc-login-alert-icon {
    color: #16a34a;
}

.tc-login-alert-box.tc-forgot-msg--success .tc-forgot-msg {
    color: #166534;
}

.tc-login-alert-box.tc-forgot-msg--error {
    background: #fff2f0;
    border-color: #ffccc7;
}

.tc-login-alert-box.tc-forgot-msg--error .tc-forgot-msg {
    color: #cf1322;
}

.tc-login-back-link {
    display: block;
    text-align: center;
    margin-top: 16px;
    font-size: 12px;
    color: #38ad87;
    text-decoration: underline;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}

.tc-login-back-link:hover {
    color: #2d9a78;
}

/* Change password page */
.tc-change-pwd-rules {
    margin: 0 0 16px;
    padding: 12px 14px;
    background: #f0f7ff;
    border: 1px solid #dbeafe;
    border-radius: 6px;
}

.tc-change-pwd-rules h5 {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: #06111f;
    font-family: 'Inter', sans-serif;
}

.tc-pwd-rule {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

.tc-pwd-rule.valid {
    color: #16a34a;
}

.tc-pwd-rule.valid::before {
    content: "✓ ";
}

.tc-pwd-rule.invalid {
    color: #d73b3e;
}

.tc-pwd-rule.invalid::before {
    content: "✕ ";
}

.tc-login-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.tc-login-btn-secondary {
    flex: 1;
    height: 32px;
    border: 1px solid #cfd3d7;
    border-radius: 4px;
    background: #fff;
    color: #06111f;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
}

.tc-login-btn-secondary:hover {
    border-color: #9db6c5;
    background: #f8fafc;
}

.tc-login-actions .tc-login-submit {
    flex: 1;
    margin-top: 0;
}

.tc-login-footer { display: none; }

/* Alerts */
.tc-login-alert-box {
    display: none;
    width: 100%;
    margin: 0 0 16px;
    padding: 8px 12px;
    border-radius: 6px;
    background: #fff2f0;
    border: 1px solid #ffccc7;
}

.tc-login-alert-box.visible {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.tc-login-alert-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    color: #ff4d4f;
}

.tc-login-alert-list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 13px;
    color: #cf1322;
}

.hp-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

/* Sign up panel */
.tc-login-card .sign-up-panel { display: none; }
#loginPanel.active .sign-in-panel { display: none; }
#loginPanel.active .sign-up-panel { display: block; }
#loginPanel.active .tc-login-powered { display: none; }

.tc-login-card .sign-up-panel .inputField,
.tc-login-card .sign-up-panel select.inputField {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    margin-bottom: 12px;
    background: #fff;
}

.tc-login-switch {
    display: block;
    width: 100%;
    margin-top: 1rem;
    border: none;
    background: transparent;
    color: var(--tc-link);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}

.tc-login-switch-hidden { display: none !important; }

.tc-login-signup-link {
    display: block;
    text-align: center;
    margin-top: 1rem;
    font-size: 13px;
    font-weight: 600;
    color: var(--tc-link);
    text-decoration: none;
}

.tc-login-page.signup-mode .tc-login-brand { display: none; }
.tc-login-page.signup-mode .tc-login-content {
    justify-content: center;
}
.tc-login-page.signup-mode .tc-login-card-wrap {
    max-width: var(--tc-login-card-width);
    flex: 1 1 auto;
}
.tc-login-page.signup-mode .tc-login-switch-hidden { display: block !important; }

/* Modal */
.tc-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.45);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.tc-modal.open { display: flex; }

.tc-modal-dialog { width: 100%; max-width: 420px; }

.tc-modal-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.tc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--tc-border);
}

.tc-modal-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--tc-navy);
}

.tc-modal-close {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    color: #9ca3af;
    cursor: pointer;
}

.tc-modal-body { padding: 1.25rem; }

.tc-modal-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
}

.tc-modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 0 1.25rem 1.25rem;
}

.tc-modal-btn-primary {
    background: var(--tc-teal);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.tc-modal-btn-secondary {
    background: #f5f5f5;
    border: 1px solid var(--tc-border);
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 900px) {
    .tc-login-page {
        padding: 24px 16px;
    }

    .tc-login-content {
        flex-direction: column;
        align-items: center;
        gap: 28px;
    }

    .tc-login-brand {
        padding-right: 0;
        min-height: 240px;
    }

    .tc-login-tool-scene {
        inset: -12px 0;
    }

    .tc-tool-float {
        opacity: 0.1;
    }

    .tc-tool-float--5,
    .tc-tool-float--6 {
        display: none;
    }

    .tc-login-brand,
    .tc-login-card-wrap {
        flex: 1 1 auto;
        max-width: var(--tc-login-card-width);
        min-width: 0;
        width: 100%;
        margin-left: 0;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tc-tool-float {
        animation: none !important;
        opacity: 0.1;
    }
}

@media (max-width: 480px) {
    .tc-login-page {
        padding: 16px 12px;
    }

    .tc-login-card {
        padding: 20px 16px;
    }

    .tc-portal-logo {
        height: 34px;
        width: auto;
    }

    .tc-portal-title {
        font-size: 26px;
    }
}

@media (min-width: 1024px) {
    .tc-login-page {
        padding: 48px 64px 48px 40px;
    }

    .tc-portal-logo {
        height: 40px;
    }

    .tc-portal-title {
        font-size: 40px;
    }

    .tc-portal-brand-lockup p {
        font-size: 16px;
    }
}
