/* ═══════════════════════════════════════════════════════════
   AXKAN Shipping Address Form
   Rappi-inspired: rounded, soft, friendly, mobile-first
   Brand: Rosa Mexicano #e72a88, Fredoka + Inter fonts
   ═══════════════════════════════════════════════════════════ */

:root {
    /* AXKAN Brand Colors */
    --rosa: #e72a88;
    --rosa-light: #fce4ef;
    --rosa-dark: #c91e73;
    --verde: #8ab73b;
    --verde-light: #eef6e0;
    --naranja: #f39223;
    --turquesa: #09adc2;

    /* Neutrals */
    --white: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #eeeeee;
    --gray-300: #e0e0e0;
    --gray-400: #bdbdbd;
    --gray-500: #9e9e9e;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;

    /* Semantic */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --error: #ef4444;
    --error-light: #fee2e2;

    /* Typography */
    --font-display: 'Fredoka', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Sizing */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 100px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════
   BACKGROUND DECORATION
   ═══════════════════════════════════════ */

.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
}

.bg-circle-1 {
    width: 400px;
    height: 400px;
    background: var(--rosa);
    top: -100px;
    right: -100px;
}

.bg-circle-2 {
    width: 300px;
    height: 300px;
    background: var(--turquesa);
    bottom: 10%;
    left: -80px;
}

.bg-circle-3 {
    width: 200px;
    height: 200px;
    background: var(--naranja);
    bottom: -50px;
    right: 20%;
}

/* ═══════════════════════════════════════
   APP CONTAINER
   ═══════════════════════════════════════ */

.app {
    position: relative;
    z-index: 1;
    max-width: 520px;
    margin: 0 auto;
    padding: 20px 16px 40px;
    min-height: 100vh;
}

/* ═══════════════════════════════════════
   HEADER
   ═══════════════════════════════════════ */

.header {
    text-align: center;
    padding: 24px 0 8px;
}

.logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 12px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.header-text h1 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.header-text p {
    font-size: 0.9rem;
    color: var(--gray-500);
    font-weight: 400;
}

/* ═══════════════════════════════════════
   PROGRESS BAR
   ═══════════════════════════════════════ */

.progress-container {
    margin: 20px 0 24px;
}

.progress-bar {
    height: 4px;
    background: var(--gray-200);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 16px;
}

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

.progress-steps {
    display: flex;
    justify-content: space-between;
    padding: 0 8px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.progress-step span {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color var(--transition);
}

.step-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    transition: all var(--transition);
    border: 2px solid transparent;
}

.progress-step.active .step-dot {
    background: var(--rosa);
    color: white;
    border-color: var(--rosa);
    box-shadow: 0 0 0 4px var(--rosa-light);
    transform: scale(1.05);
}

.progress-step.active span {
    color: var(--rosa);
    font-weight: 600;
}

.progress-step.completed .step-dot {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.progress-step.completed span {
    color: var(--success);
}

/* ═══════════════════════════════════════
   STEPS / SECTIONS
   ═══════════════════════════════════════ */

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

.step.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInReverse {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.step.slide-reverse {
    animation: slideInReverse 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════
   CARDS
   ═══════════════════════════════════════ */

.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0,0,0,0.04);
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--rosa-light);
    color: var(--rosa);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.card h2 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.card-subtitle {
    font-size: 0.88rem;
    color: var(--gray-500);
    margin-bottom: 20px;
}

/* ═══════════════════════════════════════
   RETURNING CLIENT BANNER
   ═══════════════════════════════════════ */

.returning-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--verde-light);
    border: 1px solid rgba(138, 183, 59, 0.3);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease;
}

.returning-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--verde);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.returning-banner strong {
    display: block;
    font-size: 0.9rem;
    color: var(--gray-800);
}

.returning-banner p {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin: 0;
}

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

/* ═══════════════════════════════════════
   INFO TIP
   ═══════════════════════════════════════ */

.info-tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--warning-light);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: 0.82rem;
    color: #92400e;
    line-height: 1.5;
}

.info-tip svg {
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--warning);
}

/* ═══════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════ */

.form-group {
    margin-bottom: 18px;
    position: relative;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-group label svg {
    color: var(--gray-400);
    flex-shrink: 0;
}

.optional-tag {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--gray-400);
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    text-transform: none;
    letter-spacing: 0;
    margin-left: auto;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: var(--font-body);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--gray-900);
    outline: none;
    transition: all var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

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

.form-group input:focus {
    border-color: var(--rosa);
    box-shadow: 0 0 0 4px var(--rosa-light);
}

.form-group input.autofilled {
    background: var(--verde-light);
    border-color: var(--verde);
}

.form-group input.autofilled:focus {
    box-shadow: 0 0 0 4px rgba(138, 183, 59, 0.2);
}

.form-group input.error {
    border-color: var(--error);
    box-shadow: 0 0 0 4px var(--error-light);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239e9e9e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    cursor: pointer;
}

.form-group select:focus {
    border-color: var(--rosa);
    box-shadow: 0 0 0 4px var(--rosa-light);
}

.field-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 6px;
    padding-left: 2px;
}

.field-error {
    display: none;
    font-size: 0.78rem;
    color: var(--error);
    margin-top: 6px;
    padding-left: 2px;
    font-weight: 500;
}

.field-error.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

.form-group-highlight {
    background: var(--gray-50);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 2px dashed var(--gray-200);
    margin-bottom: 20px;
}

.form-group-highlight .field-hint {
    color: var(--rosa);
    font-weight: 500;
}

/* Form row (side by side) */
.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

/* Postal code loading */
.postal-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--naranja);
    font-weight: 500;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid var(--gray-200);
    border-top-color: var(--naranja);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ═══════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════ */

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-display);
    color: white;
    background: linear-gradient(135deg, var(--rosa), var(--rosa-dark));
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 16px rgba(231, 42, 136, 0.3);
    letter-spacing: 0.3px;
    margin-top: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(231, 42, 136, 0.4);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-primary:disabled {
    background: var(--gray-300);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-display);
    color: var(--gray-600);
    background: var(--gray-100);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-secondary:hover {
    background: var(--gray-200);
    border-color: var(--gray-300);
}

.btn-secondary:active {
    transform: scale(0.98);
}

.btn-row {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.btn-row .btn-secondary {
    flex: 0 0 auto;
}

.btn-row .btn-primary {
    flex: 1;
    margin-top: 0;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-body);
    color: var(--rosa);
    background: transparent;
    border: 2px solid var(--rosa);
    border-radius: var(--radius-full);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-outline:hover {
    background: var(--rosa);
    color: white;
}

.btn-whatsapp {
    color: #25d366;
    border-color: #25d366;
}

.btn-whatsapp:hover {
    background: #25d366;
    color: white;
}

/* ═══════════════════════════════════════
   SUCCESS STATE
   ═══════════════════════════════════════ */

.card-success {
    text-align: center;
}

.spinner-large {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--rosa);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

/* Animated Checkmark */
.success-animation {
    margin: 0 auto 20px;
    width: 72px;
    height: 72px;
}

.checkmark {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    stroke-width: 2;
    stroke: var(--success);
    stroke-miterlimit: 10;
    animation: fill 0.4s ease-in-out 0.4s forwards, scale 0.3s ease-in-out 0.9s both;
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: var(--success);
    fill: none;
    animation: stroke-anim 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke-width: 3;
    animation: stroke-anim 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke-anim {
    100% { stroke-dashoffset: 0; }
}

@keyframes fill {
    100% { box-shadow: inset 0 0 0 40px rgba(16, 185, 129, 0.1); }
}

@keyframes scale {
    0%, 100% { transform: none; }
    50% { transform: scale3d(1.1, 1.1, 1); }
}

/* Summary card */
.summary-card {
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 24px 0;
    text-align: left;
}

.summary-row {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.88rem;
}

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

.summary-label {
    color: var(--gray-500);
    min-width: 90px;
    font-weight: 500;
    flex-shrink: 0;
}

.summary-value {
    color: var(--gray-800);
    font-weight: 500;
}

.success-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Error state */
.error-icon {
    color: var(--error);
    margin-bottom: 16px;
}

/* ═══════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════ */

.footer {
    text-align: center;
    padding: 32px 0 8px;
    font-size: 0.78rem;
    color: var(--gray-400);
}

.footer a {
    color: var(--rosa);
    text-decoration: none;
    font-weight: 600;
}

.footer a:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════
   CONFETTI (injected by JS)
   ═══════════════════════════════════════ */

.confetti-piece {
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    z-index: 1000;
    pointer-events: none;
    animation: confetti-fall 2.5s ease-out forwards;
}

@keyframes confetti-fall {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(720deg) scale(0.3);
    }
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */

@media (max-width: 400px) {
    .app {
        padding: 16px 12px 32px;
    }

    .card {
        padding: 24px 18px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .btn-row {
        flex-direction: column;
    }

    .btn-row .btn-secondary {
        order: 2;
    }

    .btn-row .btn-primary {
        order: 1;
    }

    .success-actions {
        flex-direction: column;
    }

    .success-actions .btn-outline {
        width: 100%;
    }
}

@media (min-width: 600px) {
    .app {
        padding: 32px 24px 60px;
    }

    .header {
        padding: 32px 0 16px;
    }

    .logo {
        width: 80px;
        height: 80px;
    }

    .header-text h1 {
        font-size: 1.8rem;
    }
}
