* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #f9fafb;
    color: #111827;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

a {
    color: inherit;
}

/* Layout */

.page-center {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.page-wide {
    max-width: 768px;
    margin: 0 auto;
    padding: 40px 16px;
}

/* Login page */

.login-page {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    /* Muted, soft backdrop behind both panels — same neutral family as
       --dash-border (#edefed) elsewhere in the app, just a touch lighter so
       it reads as a page background rather than a border. Shows through in
       the gap between the two panels below. */
    background: #f4f4f2;
    padding: 40px 20px;
}

.login-duo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
    max-width: 1120px;
    min-height: 640px;
}

.login-dark-panel,
.login-white-panel {
    display: flex;
    flex-direction: column;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 30px 80px -34px rgba(20, 23, 28, 0.2);
}

.login-dark-panel {
    justify-content: space-between;
    padding: 32px 40px 44px;
    color: #ffffff;
    /* Subtle depth only — the app's own near-black (#14171c, the sidebar
       brand mark / primary button color), not a new hue. */
    background: radial-gradient(circle at 28% 16%, #262b33 0%, #14171c 62%);
}

.login-white-panel {
    justify-content: space-between;
    padding: 32px 48px;
    background: #ffffff;
}

.login-panel-top {
    display: flex;
    align-items: center;
}

/* Shared company logo component (resources/views/components/company-logo.blade.php)
   — used on the sidebar, login page, and dashboard header. Falls back to
   the brand icon (a dark rounded badge) when no logo has been uploaded;
   shows the uploaded image, scaled to fit, with no forced background
   otherwise. Lives here (not dashboard.css) because the login page — which
   only loads app.css/ui.css, not dashboard.css — needs it too. */

.company-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.company-logo-md {
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

.company-logo-lg {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    margin-bottom: 24px;
}

.company-logo-icon {
    background: #14171c;
    color: #ffffff;
}

.company-logo-icon.company-logo-dark {
    background: rgba(255, 255, 255, 0.12);
}

.company-logo-icon svg {
    width: 50%;
    height: 50%;
}

.company-logo-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.login-hero {
    max-width: 380px;
}

.login-hero-heading {
    margin: 0 0 12px;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: #ffffff;
}

.login-hero-subtext {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.65);
}

.login-form-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-form-inner {
    width: 100%;
    max-width: 340px;
}

.login-heading {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    color: #111827;
}

.login-subtitle {
    margin: 0 0 28px;
    color: #6b7280;
    font-size: 14px;
    text-align: center;
}

.login-forgot-centered {
    display: block;
    margin-top: 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-decoration: none;
    transition: color 150ms ease;
}

.login-forgot-centered:hover {
    color: #14171c;
    text-decoration: underline;
}

.login-footer {
    margin: 0;
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
}

.form-field {
    position: relative;
    margin-bottom: 14px;
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.form-field label {
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
    color: #9ca3af;
}

.form-field input {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #111827;
}

.form-field input:focus {
    outline: none;
}

.form-field.password-field input {
    padding-right: 24px;
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 12px;
    display: flex;
    padding: 0;
    line-height: 0;
    color: #9ca3af;
    background: none;
    border: none;
    cursor: pointer;
    transform: translateY(-50%);
}

.toggle-password:hover {
    color: #374151;
}

.btn-primary {
    width: 100%;
    margin-top: 8px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background: #14171c;
    border: none;
    border-radius: 9px;
    cursor: pointer;
    transition: background 150ms ease;
}

.btn-primary:hover {
    background: #2a2e35;
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

@media (max-width: 900px) {
    .login-duo {
        grid-template-columns: 1fr;
        gap: 16px;
        min-height: 0;
    }

    .login-dark-panel,
    .login-white-panel {
        border-radius: 22px;
    }

    .login-dark-panel {
        padding: 28px 32px 32px;
    }

    .login-hero {
        max-width: none;
    }

    .login-hero-heading {
        font-size: 24px;
    }

    .login-white-panel {
        padding: 28px 32px 32px;
    }
}

@media (max-width: 560px) {
    .login-page {
        padding: 0;
    }

    .login-duo {
        gap: 0;
    }

    .login-dark-panel {
        border-radius: 0;
        padding: 24px 24px 32px;
    }

    .login-white-panel {
        border-radius: 0;
        box-shadow: none;
        padding: 24px 24px 32px;
    }
}

/* Card */

.card {
    width: 100%;
    max-width: 360px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.card-wide {
    max-width: none;
}

/* Typography */

.title {
    margin: 0 0 24px;
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    color: #111827;
}

.heading {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #111827;
}

/* Buttons */

.btn {
    display: inline-block;
    width: 100%;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    color: #ffffff;
    background: #111827;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.btn:hover {
    background: #374151;
}

.btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.btn-secondary {
    width: auto;
    color: #374151;
    background: #ffffff;
    border: 1px solid #d1d5db;
    padding: 6px 12px;
}

.btn-secondary:hover {
    background: #f3f4f6;
}

/* Alerts */

.alert-error {
    margin-bottom: 16px;
    padding: 12px 16px;
    font-size: 14px;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
}

.alert-error p {
    margin: 0;
}

.alert-error p + p {
    margin-top: 4px;
}

/* Dashboard */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
