:root {
    --aks-primary: #3b82f6; /* Modern Blue */
    --aks-primary-dark: #2563eb;
    --aks-secondary: #64748b;
    --aks-success: #10b981;
    --aks-error: #f43f5e;
    --aks-bg: #f8fafc;
    --aks-card: #ffffff;
    --aks-text: #0f172a;
    --aks-text-light: #64748b;
    --aks-radius-lg: 24px;
    --aks-radius-md: 16px;
    --aks-radius-sm: 12px;
    --aks-shadow-soft: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --aks-shadow-premium: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --aks-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --aks-glass: rgba(255, 255, 255, 0.7);
}

.aksfetch-container {
    max-width: 750px;
    margin: 60px auto;
    font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--aks-text);
    perspective: 1000px;
}

.aksfetch-form-wrapper {
    background: var(--aks-card);
    padding: 48px;
    border-radius: var(--aks-radius-lg);
    box-shadow: var(--aks-shadow-premium);
    border: 1px solid rgba(226, 232, 240, 0.5);
    position: relative;
    overflow: hidden;
}

/* Background Glass Element */
.aksfetch-form-wrapper::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: var(--aks-gradient);
    filter: blur(80px);
    opacity: 0.1;
    z-index: 0;
}

.aksfetch-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 40px;
    background: var(--aks-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}

.aksfetch-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 48px;
    position: relative;
}

.aksfetch-steps::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 15%;
    right: 15%;
    height: 2px;
    background: #e2e8f0;
    z-index: 0;
    transform: translateY(-50%);
}

.aksfetch-steps .step {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: var(--aks-secondary);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
    box-shadow: var(--aks-shadow-soft);
}

.aksfetch-steps .step.active {
    background: var(--aks-primary);
    border-color: var(--aks-primary);
    color: white;
    transform: scale(1.15);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
}

.aksfetch-steps .step.completed {
    background: var(--aks-success);
    border-color: var(--aks-success);
    color: white;
}

.aksfetch-step-content {
    display: none;
    position: relative;
    z-index: 1;
}

.aksfetch-step-content.active {
    display: block;
}

.aksfetch-step-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--aks-text);
}

.aksfetch-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.aksfetch-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.aksfetch-field.aksfetch-full {
    grid-column: span 2;
}

.aksfetch-field label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--aks-text-light);
    margin-left: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Info Icon & Tooltip */
.aksfetch-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e2e8f0;
    color: var(--aks-secondary);
    font-size: 10px;
    font-weight: 800;
    cursor: help;
    transition: all 0.2s;
    position: relative;
}

.aksfetch-info:hover {
    background: var(--aks-primary);
    color: white;
}

.aksfetch-info::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background: #1e293b;
    color: white;
    font-size: 12px;
    border-radius: 8px;
    white-space: normal;
    width: 180px;
    line-height: 1.4;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 1000;
    box-shadow: var(--aks-shadow-premium);
    pointer-events: none;
    text-align: center;
    font-weight: 500;
}

.aksfetch-info::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    border: 6px solid transparent;
    border-top-color: #1e293b;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    pointer-events: none;
}

.aksfetch-info:hover::before,
.aksfetch-info:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

.aksfetch-info:hover::after {
    transform: translateX(-50%) translateY(4px);
}

.aksfetch-field input, 
.aksfetch-field select {
    height: 52px; /* Standardize height */
    padding: 0 20px;
    border: 2px solid #f1f5f9;
    border-radius: var(--aks-radius-sm);
    font-size: 1rem;
    line-height: 52px;
    background: #f8fafc;
    transition: all 0.2s ease;
    color: var(--aks-text);
    width: 100%;
    box-sizing: border-box;
}

.aksfetch-field select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 18px;
    cursor: pointer;
    padding-right: 45px;
}

.aksfetch-field input:hover, 
.aksfetch-field select:hover {
    border-color: #e2e8f0;
}

.aksfetch-field input:focus, 
.aksfetch-field select:focus {
    outline: none;
    border-color: var(--aks-primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.aksfetch-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 10px;
}

.aksfetch-btn {
    padding: 14px 32px;
    border-radius: var(--aks-radius-md);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: none;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.aksfetch-btn:not(.secondary) {
    background: var(--aks-gradient);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.aksfetch-btn.secondary {
    background: #f1f5f9;
    color: var(--aks-secondary);
}

.aksfetch-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

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

/* Loader & Premium Spinner */
.aksfetch-results-container {
    text-align: center;
    padding: 40px 0;
}

.aksfetch-loader {
    margin-bottom: 30px;
}

.aksfetch-loader .spinner {
    width: 64px;
    height: 64px;
    border: 4px solid #f1f5f9;
    border-top: 4px solid var(--aks-primary);
    border-radius: 50%;
    margin: 0 auto 24px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.05) 0%, transparent 70%);
}

.aksfetch-loader p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--aks-text-light);
}

/* Rate Card Redesign */
.rate-card {
    background: var(--aks-card);
    border: 1px solid rgba(226, 232, 240, 0.8);
    padding: 24px;
    border-radius: var(--aks-radius-md);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: var(--aks-shadow-soft);
}

.rate-card:hover {
    transform: scale(1.02);
    box-shadow: var(--aks-shadow-premium);
    border-color: var(--aks-primary);
}

.rate-details {
    flex-grow: 1;
    text-align: left;
}

.rate-carrier {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--aks-text);
    display: block;
    margin-bottom: 2px;
}

.rate-form {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--aks-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
}

.rate-amount {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--aks-success);
    margin-right: 20px;
}

.rate-pending {
    color: var(--aks-secondary);
    font-size: 0.95rem;
    font-style: italic;
    opacity: 0.7;
}

.rate-ineligible {
    color: #94a3b8;
    background: #f8fafc;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.rate-error {
    color: var(--aks-error);
    background: #fff1f2;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.rate-message {
    font-size: 0.85rem;
    color: var(--aks-secondary);
    margin-top: 10px;
    display: block;
    line-height: 1.5;
    background: #fbfcfd;
    padding: 8px 12px;
    border-radius: 8px;
    border-left: 3px solid #e2e8f0;
}

.rate-btn {
    background: var(--aks-gradient);
    color: white !important;
    padding: 10px 20px;
    border-radius: 10px;
    text-decoration: none !important;
    font-size: 0.9rem;
    font-weight: 700;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.rate-btn:hover {
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
    transform: translateY(-2px);
}

/* Modal Styles */
.aksfetch-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.aksfetch-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.aksfetch-modal-content {
    background: var(--aks-card);
    border-radius: var(--aks-radius-lg);
    padding: 40px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    box-shadow: var(--aks-shadow-premium);
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.aksfetch-modal-overlay.active .aksfetch-modal-content {
    transform: translateY(0) scale(1);
}

.aksfetch-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--aks-text-light);
    cursor: pointer;
    line-height: 1;
    padding: 5px;
    border-radius: 50%;
    transition: color 0.2s, background 0.2s;
}

.aksfetch-modal-close:hover {
    color: var(--aks-error);
    background: #f1f5f9;
}

.aksfetch-modal-icon {
    color: var(--aks-success);
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.aksfetch-modal-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--aks-text);
    margin-bottom: 12px;
}

.aksfetch-modal-content p {
    color: var(--aks-text-light);
    font-size: 1rem;
    margin-bottom: 24px;
    line-height: 1.5;
}

.aksfetch-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.aksfetch-modal-actions .aksfetch-btn {
    width: 100%;
}

@media (max-width: 640px) {
    .aksfetch-grid {
        grid-template-columns: 1fr;
    }
    .aksfetch-field.aksfetch-full {
        grid-column: span 1;
    }
    .aksfetch-form-wrapper {
        padding: 24px;
    }
    .rate-card {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    .rate-details {
        text-align: center;
    }
    .rate-amount {
        margin-right: 0;
        display: block;
        margin-bottom: 10px;
    }
}
