/* =============================================
   login.css — Carbon Design System + Atlassian Design
   ============================================= */

/* ---- Tokens ---- */
:root {
    /* Carbon Gray scale */
    --cds-gray-100: #161616;
    --cds-gray-90:  #262626;
    --cds-gray-80:  #393939;
    --cds-gray-70:  #525252;
    --cds-gray-50:  #8d8d8d;
    --cds-gray-30:  #c6c6c6;
    --cds-gray-10:  #f4f4f4;
    --cds-white:    #ffffff;

    /* Atlassian Blue */
    --ads-blue-700: #0747a6;
    --ads-blue-500: #0052cc;
    --ads-blue-400: #2684ff;
    --ads-blue-100: #deebff;

    /* Atlassian Red */
    --ads-red-500:  #de350b;
    --ads-red-100:  #ffebe6;

    /* Atlassian Green */
    --ads-green-500: #00875a;
    --ads-green-100: #e3fcef;

    /* Atlassian Neutrals */
    --ads-n900:  #172b4d;
    --ads-n800:  #253858;
    --ads-n500:  #5e6c84;
    --ads-n300:  #b3bac5;
    --ads-n100:  #ebecf0;
    --ads-n20:   #f4f5f7;

    /* Typography */
    --font: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
    --text-body: 14px;
    --text-label: 12px;
    --radius: 3px;

    /* Spacing */
    --space-2: 4px;
    --space-3: 8px;
    --space-4: 12px;
    --space-5: 16px;
    --space-6: 20px;
    --space-7: 24px;
    --space-8: 32px;
    --space-9: 40px;
    --space-10: 48px;
}

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

html, body { height: 100%; }

body {
    font-family: var(--font);
    font-size: var(--text-body);
    color: var(--ads-n900);
    background: var(--ads-n20);
    -webkit-font-smoothing: antialiased;
}

button { cursor: pointer; font: inherit; }
a { text-decoration: none; color: inherit; }

/* =============================================
   SHELL — Split Layout
   ============================================= */
.auth-shell {
    display: grid;
    grid-template-columns: 400px 1fr;
    min-height: 100vh;
}

/* =============================================
   BRAND PANEL — Carbon Dark
   ============================================= */
.brand-panel {
    background: var(--cds-gray-100);
    color: var(--cds-white);
    display: flex;
    align-items: stretch;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand-panel__inner {
    display: flex;
    flex-direction: column;
    padding: var(--space-10) var(--space-8);
    gap: var(--space-8);
    width: 100%;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.brand-logo img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.brand-logo span {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--cds-white);
}

.brand-copy {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-5);
}

.brand-copy h2 {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--cds-white);
}

.brand-copy h2 em {
    font-style: normal;
    color: var(--ads-blue-400);
}

.brand-copy p {
    font-size: 14px;
    color: var(--cds-gray-30);
    line-height: 1.6;
    max-width: 280px;
}

.brand-bullets {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.brand-bullets li {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 13px;
    color: var(--cds-gray-30);
}

.brand-bullets svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    color: var(--ads-blue-400);
}

.brand-back {
    font-size: 12px;
    margin-top: auto;
}

.brand-back a {
    color: var(--cds-gray-50);
    transition: color .15s;
}

.brand-back a:hover { color: var(--cds-white); }

/* =============================================
   FORM PANEL — Atlassian
   ============================================= */
.form-panel {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: var(--space-10) var(--space-8);
    overflow-y: auto;
}

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

.auth-view[hidden] { display: none !important; }

/* ---- Form Header ---- */
.form-header {
    margin-bottom: var(--space-8);
}

.form-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--ads-n900);
    letter-spacing: -0.015em;
    margin-bottom: var(--space-3);
}

.form-header p {
    font-size: 14px;
    color: var(--ads-n500);
    line-height: 1.5;
}

/* Back button */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ads-blue-500);
    background: none;
    border: none;
    padding: 0;
    margin-bottom: var(--space-5);
    transition: color .15s;
}

.back-btn:hover { color: var(--ads-blue-700); }

.back-btn svg { width: 16px; height: 16px; }

/* ---- Notifications (Carbon inline) ---- */
.cds-notification {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-left: 3px solid;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin-bottom: var(--space-6);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
}

.cds-notification[hidden] { display: none !important; }

.cds-notification--error {
    background: var(--ads-red-100);
    border-color: var(--ads-red-500);
    color: #ae2a19;
}

.cds-notification--success {
    background: var(--ads-green-100);
    border-color: var(--ads-green-500);
    color: #216e4e;
}

.notif-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    margin-top: 1px;
}

/* ---- Form Items (Carbon pattern) ---- */
.cds-form-item {
    margin-bottom: var(--space-6);
}

.cds-label {
    display: block;
    font-size: var(--text-label);
    font-weight: 500;
    color: var(--ads-n800);
    margin-bottom: var(--space-2);
    letter-spacing: .01em;
}

.cds-label-hint {
    font-weight: 400;
    color: var(--ads-n500);
}

.cds-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-2);
}

.cds-label-row .cds-label { margin-bottom: 0; }

/* ---- Input (Carbon text field + Atlassian border) ---- */
.cds-input-wrapper {
    position: relative;
}

.cds-input {
    width: 100%;
    height: 40px;
    padding: 0 var(--space-5);
    font-size: 14px;
    font-family: var(--font);
    color: var(--ads-n900);
    background: var(--cds-white);
    border: 2px solid var(--ads-n300);
    border-radius: var(--radius);
    outline: none;
    transition: border-color .12s, box-shadow .12s;
}

.cds-input::placeholder { color: var(--ads-n300); }

.cds-input:hover {
    border-color: var(--ads-n500);
}

.cds-input:focus {
    border-color: var(--ads-blue-500);
    box-shadow: 0 0 0 2px var(--ads-blue-100);
}

/* Input com ícone direito */
.cds-input-wrapper .cds-input {
    padding-right: 44px;
}

.toggle-pwd {
    position: absolute;
    right: 0;
    top: 0;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    background: none;
    border: none;
    color: var(--ads-n500);
    transition: color .12s;
}

.toggle-pwd:hover { color: var(--ads-n900); }
.toggle-pwd svg { width: 16px; height: 16px; }

/* Input com erro */
.cds-form-item.has-error .cds-input {
    border-color: var(--ads-red-500);
    box-shadow: 0 0 0 2px rgba(222,53,11,.12);
}

/* Mensagem de erro (Carbon helper text) */
.cds-form-error {
    display: none;
    margin-top: var(--space-2);
    font-size: 12px;
    font-weight: 500;
    color: var(--ads-red-500);
}

.cds-form-item.has-error .cds-form-error { display: block; }

/* ---- Checkbox (Atlassian) ---- */
.cds-checkbox {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}

.cds-checkbox__input {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    margin-top: 2px;
    accent-color: var(--ads-blue-500);
    cursor: pointer;
    border-radius: 2px;
}

.cds-checkbox__label {
    font-size: 13px;
    color: var(--ads-n800);
    line-height: 1.5;
    cursor: pointer;
}

/* ---- Buttons ---- */
.cds-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    height: 40px;
    padding: 0 var(--space-5);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    border-radius: var(--radius);
    border: 2px solid transparent;
    transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
    white-space: nowrap;
}

.cds-btn--full { width: 100%; }

/* Primary — Atlassian Blue */
.cds-btn--primary {
    background: var(--ads-blue-500);
    border-color: var(--ads-blue-500);
    color: var(--cds-white);
}

.cds-btn--primary:hover {
    background: var(--ads-blue-700);
    border-color: var(--ads-blue-700);
}

.cds-btn--primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--ads-blue-100);
}

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

/* Secondary */
.cds-btn--secondary {
    background: var(--cds-white);
    border-color: var(--ads-n300);
    color: var(--ads-n800);
}

.cds-btn--secondary:hover {
    background: var(--ads-n100);
    border-color: var(--ads-n500);
}

.cds-btn--secondary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--ads-blue-100);
}

/* Google Button (Carbon + Atlassian) */
.cds-btn--google {
    background: var(--cds-white);
    border-color: var(--ads-n300);
    color: var(--ads-n900);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(9, 30, 66, 0.08);
}

.cds-btn--google:hover {
    background: var(--ads-n20);
    border-color: var(--ads-n500);
    box-shadow: 0 1px 3px rgba(9, 30, 66, 0.15);
}

.cds-btn--google:active {
    background: var(--ads-n100);
}

.cds-btn--google:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--ads-blue-100);
}

.cds-btn--google:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.google-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

/* Spinner botão (Carbon) */
.btn-spinner {
    width: 18px;
    height: 18px;
    animation: spin .7s linear infinite;
}

.btn-spinner[hidden] { display: none !important; }

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

/* ---- Links ---- */
.link-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    font-family: var(--font);
    color: var(--ads-blue-500);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: text-decoration-color .12s, color .12s;
}

.link-btn:hover {
    color: var(--ads-blue-700);
    text-decoration-color: var(--ads-blue-700);
}

.link-btn--muted { color: var(--ads-n500); }
.link-btn--muted:hover { color: var(--ads-n800); }

/* ---- Misc ---- */
.form-legal {
    margin-top: var(--space-5);
    font-size: 12px;
    color: var(--ads-n500);
    line-height: 1.5;
}

.form-divider {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin: var(--space-7) 0;
    color: var(--ads-n300);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.form-divider::before,
.form-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--ads-n100);
}

.form-help-link {
    text-align: center;
    margin-top: var(--space-6);
    font-size: 13px;
}

/* ---- Suporte cards ---- */
.suporte-cards {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-top: var(--space-7);
}

.suporte-card {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    padding: var(--space-5) var(--space-6);
    background: var(--cds-white);
    border: 2px solid var(--ads-n100);
    border-radius: var(--radius);
    text-align: left;
    text-decoration: none;
    color: var(--ads-n900);
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}

.suporte-card:hover {
    border-color: var(--ads-blue-500);
    box-shadow: 0 2px 8px rgba(0,82,204,.1);
}

.suporte-card > div {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.suporte-card strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--ads-n900);
}

.suporte-card span {
    font-size: 12px;
    color: var(--ads-n500);
}

.suporte-icon {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    color: var(--ads-blue-500);
}

.suporte-arrow {
    width: 16px;
    height: 16px;
    color: var(--ads-n300);
    flex: 0 0 16px;
}

/* =============================================
   MODAL — Atlassian Dialog
   ============================================= */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(23,43,77,.54);
    display: grid;
    place-items: center;
    padding: var(--space-6);
    animation: fadeIn .15s ease;
}

.modal-backdrop[hidden] { display: none !important; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-dialog {
    background: var(--cds-white);
    border-radius: 3px;
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - var(--space-10));
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(23,43,77,.2);
    animation: slideUp .18s ease;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-6) var(--space-7);
    border-bottom: 1px solid var(--ads-n100);
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--ads-n900);
    letter-spacing: -0.01em;
}

.modal-close-btn {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    background: none;
    border: none;
    border-radius: var(--radius);
    color: var(--ads-n500);
    transition: background .12s, color .12s;
}

.modal-close-btn:hover { background: var(--ads-n100); color: var(--ads-n900); }
.modal-close-btn svg { width: 16px; height: 16px; }

.modal-body {
    padding: var(--space-7);
    overflow-y: auto;
    flex: 1;
}

.modal-body p {
    font-size: 14px;
    color: var(--ads-n500);
    line-height: 1.65;
    margin-bottom: var(--space-5);
}

.modal-body h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--ads-n800);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-top: var(--space-6);
    margin-bottom: var(--space-3);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-7);
    border-top: 1px solid var(--ads-n100);
}

/* =============================================
   RESPONSIVO
   ============================================= */
@media (max-width: 860px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .brand-panel {
        position: static;
        height: auto;
    }

    .brand-panel__inner {
        padding: var(--space-7) var(--space-6);
        gap: var(--space-5);
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }

    .brand-copy,
    .brand-bullets,
    .brand-back { display: none; }

    .brand-logo { margin: 0; }

    .form-panel {
        padding: var(--space-7) var(--space-5);
    }
}

@media (max-width: 480px) {
    .modal-footer {
        flex-direction: column-reverse;
    }

    .modal-footer .cds-btn {
        width: 100%;
    }
}
