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

body {
    font-family: "Arial", sans-serif;
    background: linear-gradient(145deg, #1a6b2d 0%, #0e4a1f 60%, #0a3518 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.page-wrapper {
    max-width: 480px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.search-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 28px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.search-card .search-title {
    font-size: 18px;
    font-weight: 800;
    color: #1b5e20;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.search-card .search-subtitle {
    font-size: 12px;
    color: #777;
    margin-bottom: 18px;
}

.search-card .search-field {
    text-align: left;
    margin-bottom: 14px;
}

.search-card .search-field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #2e7d32;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.search-card .search-field input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #c8e6c9;
    border-radius: 10px;
    font-size: 15px;
    background: #fafff9;
    color: #333;
    font-family: inherit;
    transition: all 0.2s ease;
}

.search-card .search-field input:focus {
    border-color: #2e7d32;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.12);
    outline: none;
}

.search-card .search-field input::placeholder {
    color: #aaa;
}

.search-card .search-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    border: none;
    color: white;
    font-size: 15px;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(46, 125, 50, 0.3);
}

.search-card .search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.4);
}

.search-card .search-btn:active {
    transform: translateY(0);
}

.loading {
    display: none;
    padding: 20px;
    text-align: center;
}

.loading.active {
    display: block;
}

.spinner {
    border: 3px solid #e8f5e9;
    border-top: 3px solid #2e7d32;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: #666;
    font-size: 13px;
}

.error-message {
    display: none;
    color: #c62828;
    margin-top: 14px;
    padding: 12px 14px;
    background: #ffebee;
    border-radius: 8px;
    font-size: 13px;
    border-left: 4px solid #c62828;
    text-align: left;
}

.error-message.active {
    display: block;
}

.carnet-wrapper {
    display: none;
    animation: slideUp 0.5s ease;
}

.carnet-wrapper.active {
    display: block;
}

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

.carnet {
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    position: relative;
}

.carnet-corner-top {
    position: absolute;
    top: 0;
    right: 0;
    width: 140px;
    height: 90px;
    overflow: hidden;
    pointer-events: none;
}

.carnet-corner-top::before {
    content: "";
    position: absolute;
    top: -40px;
    right: -30px;
    width: 160px;
    height: 120px;
    background: #2e7d32;
    border-radius: 0 0 0 80px;
}

.carnet-corner-top::after {
    content: "";
    position: absolute;
    top: -30px;
    right: -20px;
    width: 130px;
    height: 100px;
    border: 3px solid #c8a415;
    border-radius: 0 0 0 70px;
    background: transparent;
}

.carnet-corner-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100px;
    height: 70px;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.carnet-corner-bottom::before {
    content: "";
    position: absolute;
    bottom: -30px;
    left: -20px;
    width: 120px;
    height: 90px;
    background: #2e7d32;
    border-radius: 0 60px 0 0;
}

.carnet-corner-bottom::after {
    content: "";
    position: absolute;
    bottom: -20px;
    left: -10px;
    width: 100px;
    height: 70px;
    border: 3px solid #c8a415;
    border-radius: 0 50px 0 0;
    background: transparent;
}

.carnet-body {
    padding: 28px 24px 16px;
    position: relative;
    z-index: 1;
}

.carnet-top {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.carnet-left {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 130px;
}

.carnet-logo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 4px solid #c62828;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    box-shadow: 0 4px 16px rgba(198, 40, 40, 0.2);
    margin-bottom: 6px;
}

.carnet-logo img {
    max-width: 100%;
    max-height: 100%;
}

.carnet-brand {
    font-size: 10px;
    font-weight: 800;
    color: #1b5e20;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.2;
    margin-bottom: 2px;
}

.carnet-nit {
    font-size: 9px;
    color: #777;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
}

.carnet-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #e8f5e9;
    border: 1.5px solid #43a047;
    border-radius: 16px;
    padding: 4px 10px;
}

.carnet-badge-icon {
    width: 18px;
    height: 18px;
    background: #2e7d32;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: bold;
    flex-shrink: 0;
}

.carnet-badge-text {
    font-size: 8px;
    font-weight: 800;
    color: #1b5e20;
    text-transform: uppercase;
    line-height: 1.3;
    letter-spacing: 0.3px;
}

.carnet-right {
    flex: 1;
    padding-top: 4px;
}

.carnet-title {
    font-size: 17px;
    font-weight: 900;
    color: #1b5e20;
    text-transform: uppercase;
    line-height: 1.25;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.carnet-separator {
    width: 50px;
    height: 3px;
    background: #c8a415;
    border-radius: 2px;
    margin-bottom: 14px;
}

.carnet-field {
    margin-bottom: 12px;
}

.carnet-field-label {
    font-size: 12px;
    color: #555;
    font-weight: 600;
    font-style: italic;
    margin-bottom: 4px;
}

.carnet-field-value {
    font-size: 14px;
    color: #222;
    font-weight: 700;
    padding-bottom: 6px;
    border-bottom: 1.5px solid #ccc;
    min-height: 22px;
    text-transform: uppercase;
}

.carnet-acceso {
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    margin: 0 24px;
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.carnet-acceso-star {
    color: #c8a415;
    font-size: 20px;
    flex-shrink: 0;
}

.carnet-acceso-text {
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1.4;
}

.carnet-footer {
    padding: 12px 24px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    position: relative;
    z-index: 1;
    margin-top: 10px;
}

.carnet-footer-icon {
    color: #c8a415;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

.carnet-footer-text {
    font-size: 9px;
    color: #888;
    line-height: 1.5;
    font-style: italic;
}

.carnet-contact {
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    padding: 8px 20px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.carnet-contact-text {
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

@media (max-width: 480px) {
    .page-wrapper {
        gap: 16px;
    }

    .search-card {
        padding: 22px 18px;
    }

    .carnet-body {
        padding: 20px 16px 12px;
    }

    .carnet-left {
        width: 110px;
    }

    .carnet-logo {
        width: 74px;
        height: 74px;
    }

    .carnet-title {
        font-size: 14px;
    }

    .carnet-field-label {
        font-size: 11px;
    }

    .carnet-field-value {
        font-size: 13px;
    }

    .carnet-acceso {
        margin: 0 16px;
    }

    .carnet-footer {
        padding: 10px 16px;
    }
}
