* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --red: #DC2626;
    --red-dark: #B91C1C;
    --red-light: #FEE2E2;
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-400: #9CA3AF;
    --gray-600: #4B5563;
    --gray-800: #1F2937;
    --gray-900: #111827;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background-color: var(--white);
    position: relative;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.app::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: url("/images/logo.png");
    background-repeat: repeat;
    background-size: 45px 45px;
    opacity: 0.14;
    filter: grayscale(100%) brightness(0.7);
    transform: rotate(-30deg);
    z-index: 0;
    pointer-events: none;
}

.app > * {
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(220, 38, 38, 0.3);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.3px;
}

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

/* Progress Bar */
.progress-bar {
    height: 4px;
    background: var(--gray-200);
    position: sticky;
    top: 62px;
    z-index: 99;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--red), #F87171);
    width: 16.66%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 2px 2px 0;
}

/* Steps */
.step {
    display: none;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.step.active {
    display: block;
}

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

/* Step 1 Header */
.step1-header {
    padding: 28px 24px 8px;
    text-align: center;
}

.step-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--gray-900);
    text-align: center;
    margin-bottom: 8px;
    line-height: 1.4;
}

.step-subtitle {
    font-size: 13px;
    color: var(--gray-400);
    font-weight: 500;
}

/* ===== CAROUSEL ===== */
.carousel-wrapper {
    position: relative;
    padding: 16px 0 24px;
}

.carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 16px 24px 24px;
    gap: 20px;
}

.carousel::-webkit-scrollbar {
    display: none;
}

.carousel-slide {
    flex: 0 0 85%;
    scroll-snap-align: center;
    cursor: pointer;
}

/* Tractor Card V2 */
.tractor-card-v2 {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: 24px;
    padding: 24px 20px 20px;
    position: relative;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.tractor-card-v2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--red), #F87171);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.carousel-slide.selected .tractor-card-v2 {
    border-color: var(--red);
    box-shadow: 0 8px 32px rgba(220, 38, 38, 0.18);
    transform: scale(1.02);
}

.carousel-slide.selected .tractor-card-v2::before {
    opacity: 1;
}

.card-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: var(--gray-50);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-400);
    border: 1px solid var(--gray-200);
}

.carousel-slide.selected .card-badge {
    background: var(--red);
    color: white;
    border-color: var(--red);
}

/* Tractor Image */
.tractor-image-wrap {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    padding: 8px;
}

.tractor-float {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: tractorFloat 3s ease-in-out infinite;
}

.tractor-float svg,
.tractor-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes tractorFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Card Info */
.tractor-card-info {
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-100);
}

.tractor-card-info .tractor-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.tractor-card-info .tractor-serial {
    font-size: 12px;
    color: var(--gray-400);
    font-weight: 600;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

/* Select Button */
.card-select-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: var(--gray-50);
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-600);
    transition: all 0.3s ease;
}

.carousel-slide.selected .card-select-btn {
    background: var(--red);
    color: white;
}

/* Carousel Dots */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 8px 0;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-200);
    transition: all 0.3s ease;
    cursor: pointer;
}

.dot.active {
    width: 24px;
    border-radius: 4px;
    background: var(--red);
}

/* Swipe Hint */
.swipe-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    font-size: 12px;
    color: var(--gray-400);
    font-weight: 500;
    animation: hintPulse 2s ease-in-out infinite;
}

@keyframes hintPulse {
    0%, 100% { opacity: 0.5; transform: translateX(0); }
    50% { opacity: 1; transform: translateX(5px); }
}

/* ===== BACK BUTTON ===== */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 16px;
}

.btn-back:active {
    background: var(--gray-100);
    transform: scale(0.97);
}

/* ===== PASSWORD TOGGLE ===== */
.input-password-wrap {
    position: relative;
}

.input-password-wrap .form-input {
    padding-right: 56px;
}

.toggle-password {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    transition: color 0.2s ease;
    border-radius: 10px;
}

.toggle-password:active {
    color: var(--red);
    background: var(--red-light);
}

/* ===== DETAIL CARD ===== */
.step#step2 {
    padding: 24px 20px;
}

.tractor-detail-card {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: 20px;
    padding: 28px 24px;
    text-align: center;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.detail-image {
    width: 220px;
    height: 160px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-image svg,
.detail-image .tractor-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.detail-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.detail-serial {
    font-size: 13px;
    color: var(--gray-400);
    font-family: 'Courier New', monospace;
    margin-bottom: 24px;
    letter-spacing: 1px;
}

.detail-specs {
    text-align: left;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
}

.spec-row:last-child {
    border-bottom: none;
}

.spec-label {
    color: var(--gray-400);
    font-weight: 500;
}

.spec-value {
    color: var(--gray-900);
    font-weight: 600;
}

/* ===== FORM SECTIONS ===== */
.form-section {
    text-align: center;
    padding: 50px 24px;
}

.form-icon {
    margin-bottom: 28px;
    width: 80px;
    height: 80px;
    background: var(--red-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
}

.form-description {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 36px;
    line-height: 1.6;
}

.input-group {
    margin-bottom: 28px;
    text-align: left;
}

.form-input {
    width: 100%;
    padding: 18px 20px;
    border: 2px solid var(--gray-200);
    border-radius: 14px;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    color: var(--gray-900);
    background: var(--gray-50);
    transition: all 0.25s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--red);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08);
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-input.error {
    border-color: var(--red);
    background: var(--red-light);
}

.input-error {
    display: none;
    font-size: 13px;
    color: var(--red);
    margin-top: 8px;
    padding-left: 4px;
    font-weight: 500;
}

.input-error.show {
    display: block;
}

/* ===== BUTTONS ===== */
.btn {
    display: block;
    width: 100%;
    padding: 18px 32px;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    color: var(--white);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.35);
}

.btn-primary:active {
    transform: scale(0.97);
    box-shadow: 0 3px 12px rgba(220, 38, 38, 0.3);
}

/* ===== SUCCESS ===== */
.success-section {
    text-align: center;
    padding: 60px 24px 40px;
}

.success-icon {
    width: 100px;
    height: 100px;
    background: var(--red-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 28px;
    animation: scaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.success-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 12px;
}

.success-message {
    font-size: 14px;
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: 36px;
}

.success-summary {
    background: var(--gray-50);
    border-radius: 16px;
    padding: 20px;
    text-align: left;
    border: 1px solid var(--gray-200);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--gray-100);
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-label {
    color: var(--gray-400);
    font-weight: 500;
}

.summary-value {
    color: var(--gray-900);
    font-weight: 600;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 481px) {
    .app {
        margin-top: 0;
    }
    .carousel-slide {
        flex: 0 0 75%;
    }
}

@media (max-width: 360px) {
    .step-title {
        font-size: 17px;
    }
    .tractor-image-wrap {
        height: 150px;
    }
    .carousel-slide {
        flex: 0 0 88%;
    }
}
