/* =============================================
   MLBR Bug Report — Design System
   Brand: CENIC (#0d5430 green, #f5c205 yellow)
   ============================================= */

/* --- CSS Variables / Design Tokens --- */
:root {
    --brand-green: #0d5430;
    --brand-green-light: #11713f;
    --brand-green-dark: #093d22;
    --brand-green-subtle: #e8f5ee;
    --brand-yellow: #f5c205;
    --brand-yellow-hover: #e6b600;
    --brand-yellow-light: #fef9e7;

    --bg-primary: #f0f2f5;
    --bg-card: #ffffff;
    --bg-footer: #1a1a2e;

    --text-primary: #1a1a2e;
    --text-secondary: #5a5a7a;
    --text-muted: #8e8ea0;
    --text-inverse: #ffffff;

    --border-light: #e2e4e9;
    --border-focus: var(--brand-green);
    --border-error: #e74c3c;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 2px 16px rgba(13, 84, 48, 0.06);
    --shadow-glow: 0 0 0 3px rgba(13, 84, 48, 0.15);

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-xs: 0.75rem;
    --font-sm: 0.875rem;
    --font-base: 1rem;
    --font-lg: 1.125rem;
    --font-xl: 1.25rem;
    --font-2xl: 1.5rem;
    --font-3xl: 2rem;

    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Header --- */
.header {
    background: linear-gradient(135deg, var(--brand-green-dark), var(--brand-green), var(--brand-green-light));
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(13, 84, 48, 0.3);
}

.header__inner {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header__logo {
    height: 32px;
    width: auto;
    object-fit: contain;
    background: white;
    padding: 4px;
    border-radius: 4px;
    transition: transform var(--transition-base);
}

.header__logo:hover {
    transform: scale(1.05);
}

/* --- Main --- */
.main {
    flex: 1;
    padding: 0 16px 48px;
}

.container {
    max-width: 720px;
    margin: 0 auto;
}

/* --- Hero --- */
.hero {
    text-align: center;
    padding: 48px 24px 40px;
    animation: fadeInDown 0.6s ease;
}

.hero__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background: var(--brand-green-subtle);
    color: var(--brand-green);
    margin-bottom: 20px;
}

.hero__title {
    font-size: var(--font-3xl);
    font-weight: 700;
    color: var(--brand-green);
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.hero__subtitle {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
}

.hero__description {
    font-size: var(--font-base);
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}

/* --- Form --- */
.form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.form__group {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 28px 28px 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    transition: box-shadow var(--transition-base), border-color var(--transition-base);
    animation: fadeInUp 0.5s ease backwards;
}

.form__group:nth-child(1) { animation-delay: 0.1s; }
.form__group:nth-child(2) { animation-delay: 0.2s; }
.form__group:nth-child(3) { animation-delay: 0.3s; }
.form__group:nth-child(4) { animation-delay: 0.4s; }
.form__group:nth-child(5) { animation-delay: 0.5s; }

.form__group:focus-within {
    border-color: var(--brand-green);
    box-shadow: var(--shadow-card), var(--shadow-glow);
}

.form__group.has-error {
    border-color: var(--border-error);
    box-shadow: var(--shadow-card), 0 0 0 3px rgba(231, 76, 60, 0.12);
}

.form__label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: var(--font-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.4;
}

.form__step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--brand-green);
    color: var(--text-inverse);
    font-size: var(--font-xs);
    font-weight: 700;
    flex-shrink: 0;
    margin-top: -1px;
}

.form__required {
    color: var(--border-error);
    font-weight: 700;
    margin-left: 2px;
}

.form__error {
    display: none;
    font-size: var(--font-sm);
    color: var(--border-error);
    margin-top: 10px;
    padding-left: 38px;
    animation: shake 0.3s ease;
}

.form__group.has-error .form__error {
    display: block;
}

/* --- Radio Cards --- */
.form__radio-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-light);
    background: var(--bg-card);
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
    position: relative;
}

.radio-card:hover {
    border-color: var(--brand-green);
    background: var(--brand-green-subtle);
}

.radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-card__indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    border: 2px solid var(--border-light);
    flex-shrink: 0;
    transition: all var(--transition-fast);
    position: relative;
}

.radio-card__indicator::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background: var(--brand-green);
    transform: scale(0);
    transition: transform var(--transition-fast);
}

.radio-card input[type="radio"]:checked ~ .radio-card__indicator {
    border-color: var(--brand-green);
}

.radio-card input[type="radio"]:checked ~ .radio-card__indicator::after {
    transform: scale(1);
}

.radio-card input[type="radio"]:checked ~ .radio-card__text {
    color: var(--brand-green);
    font-weight: 500;
}

.radio-card:has(input:checked) {
    border-color: var(--brand-green);
    background: var(--brand-green-subtle);
    box-shadow: 0 0 0 1px var(--brand-green);
}

.radio-card input[type="radio"]:focus-visible ~ .radio-card__indicator {
    box-shadow: var(--shadow-glow);
}

.radio-card__icon {
    font-size: 1.2em;
    flex-shrink: 0;
}

.radio-card__text {
    font-size: var(--font-sm);
    color: var(--text-primary);
    transition: color var(--transition-fast), font-weight var(--transition-fast);
    line-height: 1.4;
}

/* --- Inputs & Textarea --- */
.form__input,
.form__textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-sm);
    color: var(--text-primary);
    background: var(--bg-card);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    line-height: 1.6;
}

.form__textarea {
    resize: vertical;
}

.form__input::placeholder,
.form__textarea::placeholder {
    color: var(--text-muted);
}

.form__input:focus,
.form__textarea:focus {
    outline: none;
    border-color: var(--brand-green);
    box-shadow: var(--shadow-glow);
}

/* --- Upload Zone --- */
.upload-zone {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #fafbfc, #f5f7fa);
}

.upload-zone:hover,
.upload-zone.is-dragover {
    border-color: var(--brand-green);
    background: var(--brand-green-subtle);
}

.upload-zone.is-dragover {
    transform: scale(1.01);
    box-shadow: var(--shadow-glow);
}

.upload-zone__input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.upload-zone__icon {
    color: var(--text-muted);
    margin-bottom: 12px;
    transition: color var(--transition-fast);
}

.upload-zone:hover .upload-zone__icon {
    color: var(--brand-green);
}

.upload-zone__text {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.upload-zone__text strong {
    color: var(--brand-green);
}

.upload-zone__hint {
    font-size: var(--font-xs);
    color: var(--text-muted);
}

/* Upload Preview */
.upload-zone__preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
}

.upload-zone__preview[hidden] {
    display: none !important;
}

[hidden] {
    display: none !important;
}

.upload-zone__file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    color: var(--brand-green);
}

.upload-zone__filename {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-zone__filesize {
    font-size: var(--font-xs);
    color: var(--text-muted);
    flex-shrink: 0;
}

.upload-zone__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: none;
    background: rgba(231, 76, 60, 0.08);
    color: var(--border-error);
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 3;
    position: relative;
    flex-shrink: 0;
}

.upload-zone__remove:hover {
    background: rgba(231, 76, 60, 0.15);
    transform: scale(1.1);
}

.upload-zone.has-file {
    border-style: solid;
    border-color: var(--brand-green);
    background: var(--brand-green-subtle);
    padding: 18px 20px;
}

/* --- Buttons --- */
.form__actions {
    padding: 8px 0 20px;
    animation: fadeInUp 0.5s ease backwards;
    animation-delay: 0.6s;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 40px;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-base);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn--primary {
    background: var(--brand-yellow);
    color: var(--text-primary);
    width: 100%;
    box-shadow: 0 4px 16px rgba(245, 194, 5, 0.3);
}

.btn--primary:hover:not(:disabled) {
    background: var(--brand-yellow-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(245, 194, 5, 0.4);
}

.btn--primary:active:not(:disabled) {
    transform: translateY(0);
}

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

.btn--outline {
    background: transparent;
    color: var(--brand-green);
    border-color: var(--brand-green);
    margin-top: 24px;
}

.btn--outline:hover {
    background: var(--brand-green);
    color: var(--text-inverse);
}

.btn__loader {
    display: inline-flex;
    animation: spin 0.8s linear infinite;
}

/* --- Spinner --- */
.spinner {
    animation: spin 0.8s linear infinite;
}

/* --- Success State --- */
.success {
    text-align: center;
    padding: 64px 24px;
    animation: fadeInUp 0.6s ease;
}

.success__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    border-radius: var(--radius-full);
    background: var(--brand-green-subtle);
    color: var(--brand-green);
    margin-bottom: 24px;
    animation: successPop 0.5s ease;
}

.success__title {
    font-size: var(--font-2xl);
    font-weight: 700;
    color: var(--brand-green);
    margin-bottom: 12px;
}

.success__text {
    font-size: var(--font-base);
    color: var(--text-secondary);
    margin-bottom: 16px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.success__id {
    font-size: var(--font-sm);
    color: var(--text-muted);
    background: var(--brand-green-subtle);
    display: inline-block;
    padding: 8px 20px;
    border-radius: var(--radius-full);
}

.success__id strong {
    color: var(--brand-green);
}

/* --- Footer --- */
.footer {
    background: var(--bg-footer);
    padding: 24px 16px;
    text-align: center;
}

.footer__inner {
    max-width: 720px;
    margin: 0 auto;
}

.footer p {
    font-size: var(--font-xs);
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.6;
}

.footer p:first-child {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
}

/* --- Animations --- */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

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

@keyframes successPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .hero {
        padding: 32px 16px 28px;
    }

    .hero__title {
        font-size: var(--font-2xl);
    }

    .hero__description {
        font-size: var(--font-sm);
    }

    .form__group {
        padding: 20px 18px;
        border-radius: var(--radius-md);
    }

    .form__label {
        font-size: var(--font-sm);
    }

    .radio-card {
        padding: 12px 14px;
    }

    .radio-card__text {
        font-size: var(--font-xs);
    }

    .btn--primary {
        padding: 14px 24px;
    }
}

@media (max-width: 380px) {
    .hero__icon {
        width: 60px;
        height: 60px;
    }

    .hero__icon svg {
        width: 32px;
        height: 32px;
    }
}
