/**
 * Fortune Commerce / FortuneVantage login — matches DESIGN_LANGUAGE_AUTH_IDENTITY.md
 */

.fc-login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    padding: 1rem;
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.fc-login-card {
    width: 100%;
    max-width: 24rem;
    border-radius: 1.5rem;
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: 2rem;
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.08), 0 1px 2px -1px rgb(0 0 0 / 0.08);
}

.fc-login-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.fc-login-logo {
    height: 4rem;
    width: 4rem;
    object-fit: cover;
    border-radius: 50%;
}

.fc-login-title {
    color: #379f3c;
    font-weight: 600;
    font-size: 1.25rem;
    text-align: center;
    margin: 0;
}

.fc-login-subtitle {
    text-align: center;
    font-size: 0.875rem;
    color: #4b5563;
    margin: 0.25rem 0 1.5rem;
    font-weight: 500;
}

.fc-login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fc-login-field {
    margin: 0;
}

.fc-login-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.fc-login-input {
    width: 100%;
    border-radius: 1rem;
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    color: #111827;
    background: #fff;
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.06);
    touch-action: manipulation;
    min-height: 44px;
}

.fc-login-input:focus {
    border-color: #379f3c;
    outline: none;
    box-shadow: 0 0 0 1px #379f3c;
}

.fc-login-password-wrap {
    position: relative;
}

.fc-login-password-wrap .fc-login-input {
    padding-right: 5rem;
}

.fc-login-show-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    border-radius: 0.5rem;
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    touch-action: manipulation;
}

.fc-login-show-btn:hover {
    background: #f3f4f6;
}

.fc-login-show-btn:active {
    background: #e5e7eb;
}

.fc-login-terms-line {
    text-align: center;
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #6b7280;
}

.fc-login-terms-link {
    border: none;
    background: none;
    padding: 0;
    font-size: inherit;
    font-family: inherit;
    color: #2d8a31;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}

.fc-login-terms-link:hover {
    text-decoration: underline;
}

.fc-login-error {
    color: #dc2626;
    font-size: 0.875rem;
    margin: 0;
}

.fc-login-submit {
    width: 100%;
    border: none;
    border-radius: 1.25rem;
    background: #379f3c;
    color: #fff;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    min-height: 44px;
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.06);
    cursor: pointer;
    touch-action: manipulation;
}

.fc-login-submit:hover:not(:disabled) {
    background: #2d8a31;
}

.fc-login-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.fc-login-back {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #2d8a31;
    text-decoration: none;
}

.fc-login-back:hover {
    text-decoration: underline;
}

@media (max-width: 560px) {
    .fc-login-page {
        padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
        justify-content: flex-start;
        padding-top: max(2rem, env(safe-area-inset-top));
    }

    .fc-login-card {
        padding: 1.5rem 1.15rem;
        border-radius: 1.25rem;
    }
}

.fc-terms-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgb(0 0 0 / 0.5);
}

.fc-terms-overlay[hidden] {
    display: none;
}

.fc-terms-panel {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
    max-width: 42rem;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.fc-terms-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.fc-terms-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.fc-terms-close-icon {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
}

.fc-terms-close-icon:hover {
    background: #f3f4f6;
    color: #111827;
}

.fc-terms-body {
    overflow-y: auto;
    padding: 0;
    flex: 1;
}

.fc-terms-doc {
    padding: 1.25rem 1.5rem;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #374151;
}

.fc-terms-doc p {
    margin: 0 0 0.75rem;
}

.fc-terms-doc p:last-child {
    margin-bottom: 0;
}

.fc-terms-doc ul {
    margin: 0 0 0.75rem;
    padding-left: 1.25rem;
}

.fc-terms-doc ul ul {
    margin-top: 0.35rem;
    margin-bottom: 0.35rem;
}

.fc-terms-doc li {
    margin-bottom: 0.35rem;
}

.fc-terms-doc li:last-child {
    margin-bottom: 0;
}

.fc-terms-doc a {
    color: #2d8a31;
    font-weight: 500;
    text-decoration: underline;
}

.fc-terms-doc a:hover {
    color: #379f3c;
}

.fc-terms-doc code {
    font-size: 0.8125rem;
    background: #f3f4f6;
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
}

.fc-terms-section {
    margin-bottom: 1.5rem;
}

.fc-terms-section:last-child {
    margin-bottom: 0;
}

.fc-section-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 1rem;
    line-height: 1.35;
}

.fc-block {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1rem 1.125rem;
    margin-bottom: 0.75rem;
}

.fc-block:last-child {
    margin-bottom: 0;
}

.fc-block--danger {
    background: #fef2f2;
    border-color: #fecaca;
    border-left: 4px solid #dc2626;
}

.fc-block--warn {
    background: #fffbeb;
    border-color: #fde68a;
    border-left: 4px solid #d97706;
}

.fc-block--info {
    background: #f0fdf4;
    border-color: #bbf7d0;
    border-left: 4px solid #379f3c;
}

.fc-block-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem;
}

.fc-callout {
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    line-height: 1.55;
}

.fc-callout--info {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 4px solid #379f3c;
}

.fc-callout--warn {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #d97706;
}

.fc-callout ul {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
}

.fc-terms-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 1.5rem 0;
}

.fc-meta {
    display: block;
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.5;
}

.fc-terms-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.fc-terms-footer .fc-login-submit {
    width: 100%;
}

.fc-legal-page {
    min-height: 100vh;
    background: #f9fafb;
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #111827;
}

.fc-legal-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.fc-legal-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #14532d;
    font-weight: 700;
    text-decoration: none;
}

.fc-legal-brand img {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    object-fit: cover;
}

.fc-legal-nav {
    display: flex;
    gap: 1rem;
}

.fc-legal-nav a {
    color: #4b5563;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
}

.fc-legal-nav a.active,
.fc-legal-nav a:hover {
    color: #2d8a31;
}

.fc-legal-wrap {
    max-width: 42rem;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.fc-legal-h1 {
    font-size: 1.5rem;
    margin: 0 0 0.35rem;
}

.fc-legal-lead {
    color: #4b5563;
    margin: 0 0 1.25rem;
    font-size: 0.9375rem;
}

.fc-legal-wrap .fc-terms-doc {
    padding: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
}

@media (prefers-reduced-motion: reduce) {
    .fc-login-page *,
    .fc-terms-overlay *,
    .fc-legal-page * {
        transition: none !important;
        animation: none !important;
    }
}
