/* ================================================================
   AGRI CERTIFY — 农业认证管理平台登录页
   Design System: Green-based agricultural certification theme
   ================================================================ */

/* ---------- CSS Variables (Design Tokens) ---------- */
:root {
    /* 品牌绿色系统 */
    --g50:  #f0fdf4;
    --g100: #dcfce7;
    --g200: #bbf7d0;
    --g300: #86efac;
    --g400: #4ade80;
    --g500: #22c55e;
    --g600: #16a34a;
    --g700: #15803d;
    --g800: #166534;
    --g900: #14532d;
    --g950: #052e16;

    /* 中性色 */
    --slate-50:  #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    /* 功能色 */
    --red-50:  #fef2f2;
    --red-400: #f87171;
    --red-500: #ef4444;
    --red-700: #b91c1c;

    --white: #ffffff;

    /* 字体 */
    /* 字体（纯系统字体栈） */
    --font-serif: Georgia, 'Times New Roman', 'Songti SC', 'SimSun', serif;
    --font-mono:  'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, 'Courier New', monospace;
    --font-sans:  -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;

    /* 圆角 */
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    /* 阴影 */
    --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md:  0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg:  0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl:  0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);

    /* 过渡 */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--slate-50);
    color: var(--slate-900);
    min-height: 100vh;
}

/* ---------- Layout ---------- */
.login-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ---------- 左侧品牌展示区 ---------- */
.brand-panel {
    position: relative;
    width: 42%;
    min-width: 380px;
    max-width: 560px;
    background: var(--g950);
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 3rem;
    overflow: hidden;
    flex-shrink: 0;
}

/* 几何装饰 */
.brand-decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.decor-circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.decor-circle--1 {
    width: 480px;
    height: 480px;
    top: -120px;
    right: -160px;
    background: radial-gradient(circle, rgba(34, 197, 94, 0.08) 0%, transparent 70%);
}

.decor-circle--2 {
    width: 320px;
    height: 320px;
    bottom: -80px;
    left: -100px;
    background: radial-gradient(circle, rgba(74, 222, 128, 0.06) 0%, transparent 70%);
}

.decor-circle--3 {
    width: 160px;
    height: 160px;
    top: 50%;
    left: 60%;
    background: radial-gradient(circle, rgba(134, 239, 172, 0.05) 0%, transparent 70%);
}

.decor-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
}

/* 品牌内容 */
.brand-content {
    position: relative;
    z-index: 1;
}

.brand-logo {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    backdrop-filter: blur(8px);
}

.brand-logo svg {
    width: 32px;
    height: 32px;
}

.brand-name {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--white);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.brand-tagline {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--g300);
    margin-bottom: 0.25rem;
    letter-spacing: 0.04em;
}

.brand-desc {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.02em;
    margin-bottom: 3rem;
}

/* 功能特性列表 */
.feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.1);
}

.feature-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: rgba(34, 197, 94, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--g400);
}

.feature-icon svg {
    width: 20px;
    height: 20px;
}

.feature-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.feature-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--white);
    letter-spacing: 0.01em;
}

.feature-desc {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.4;
}

/* 底部版权 */
.brand-footer {
    position: relative;
    z-index: 1;
    margin-top: auto;
    padding-top: 3rem;
}

.brand-footer p {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.25);
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}

/* ---------- 右侧登录表单区 ---------- */
.form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--white);
}

.form-inner {
    width: 100%;
    max-width: 400px;
}

/* 移动端品牌标识（默认隐藏） */
.mobile-brand {
    display: none;
    text-align: center;
    margin-bottom: 2rem;
}

.mobile-brand-name {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--g800);
    letter-spacing: 0.06em;
}

.mobile-brand-tagline {
    font-size: 0.85rem;
    color: var(--slate-500);
    margin-top: 0.25rem;
}

/* 表单头部 */
.form-header {
    margin-bottom: 2rem;
}

.form-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--slate-900);
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.form-subtitle {
    font-size: 0.9rem;
    color: var(--slate-500);
    margin-top: 0.5rem;
    line-height: 1.5;
}

/* ---------- 消息提示 ---------- */
.alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
    animation: alertSlideIn 0.3s var(--ease-out);
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert--error {
    background: var(--red-50);
    border-color: rgba(239, 68, 68, 0.15);
}

.alert--success {
    background: var(--g50);
    border-color: rgba(34, 197, 94, 0.15);
}

.alert__content {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.85rem;
    line-height: 1.4;
}

.alert__icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.alert--error .alert__icon {
    color: var(--red-500);
}

.alert--error .alert__content {
    color: var(--red-700);
}

.alert--success .alert__icon {
    color: var(--g600);
}

.alert--success .alert__content {
    color: var(--g800);
}

/* ---------- 表单 ---------- */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--slate-700);
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 0.875rem;
    width: 18px;
    height: 18px;
    color: var(--slate-400);
    pointer-events: none;
    transition: color 0.2s ease;
}

.form-input {
    appearance: none;
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--slate-900);
    background: var(--white);
    border: 1.5px solid var(--slate-200);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input::placeholder {
    color: var(--slate-400);
    font-weight: 400;
}

.form-input:hover {
    border-color: var(--slate-300);
}

.form-input:focus {
    border-color: var(--g500);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.form-input:focus ~ .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--g600);
}

/* ---------- 登录按钮 ---------- */
.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem 1.5rem;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--white);
    background: linear-gradient(135deg, var(--g600), var(--g700));
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25), 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-top: 0.5rem;
}

.btn-login::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--g700), var(--g800));
    opacity: 0;
    transition: opacity 0.25s ease;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(22, 163, 74, 0.3), 0 2px 6px rgba(0, 0, 0, 0.08);
}

.btn-login:hover::before {
    opacity: 1;
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.2);
}

.btn-login span,
.btn-login .btn-arrow {
    position: relative;
    z-index: 1;
}

.btn-arrow {
    width: 18px;
    height: 18px;
    transition: transform 0.2s var(--ease-out);
}

.btn-login:hover .btn-arrow {
    transform: translateX(3px);
}

/* ---------- 底部链接 ---------- */
.form-footer {
    margin-top: 2rem;
    text-align: center;
}

.link-back {
    font-size: 0.85rem;
    color: var(--slate-500);
    text-decoration: none;
    transition: color 0.2s ease;
}

.link-back:hover {
    color: var(--g700);
}

/* ---------- 响应式设计 ---------- */

/* 平板及以下：隐藏左栏 */
@media (max-width: 768px) {
    .brand-panel {
        display: none;
    }

    .form-panel {
        min-height: 100vh;
    }

    .mobile-brand {
        display: block;
    }

    .form-inner {
        max-width: 360px;
    }
}

/* 小屏手机 */
@media (max-width: 480px) {
    .form-panel {
        padding: 1.5rem;
    }

    .form-title {
        font-size: 1.5rem;
    }

    .form-inner {
        max-width: 100%;
    }
}

/* 大屏优化 */
@media (min-width: 1200px) {
    .brand-panel {
        width: 45%;
        padding: 4rem;
    }

    .brand-name {
        font-size: 2.75rem;
    }
}

/* 超宽屏 */
@media (min-width: 1440px) {
    .brand-panel {
        max-width: 620px;
    }
}

/* ---------- 可访问性 ---------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---------- 焦点可见性（键盘导航） ---------- */
.form-input:focus-visible {
    outline: 2px solid var(--g500);
    outline-offset: 1px;
}

.btn-login:focus-visible {
    outline: 2px solid var(--g500);
    outline-offset: 2px;
}

.link-back:focus-visible {
    outline: 2px solid var(--g500);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}
