@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap');

#vietqr-embed,
#vietqr-embed * {
    box-sizing: border-box;
}

#vietqr-embed {
    --vq-primary: #0e57a7;
    --vq-primary-2: #1f77d8;
    --vq-line: #d4dbe4;
    --vq-text: #103463;
    --vq-muted: #6a7f9f;
    --vq-bg: #eef2f7;
    --vq-danger: #d93434;
    --vq-success: #1f9d57;

    font-family: 'Roboto', sans-serif;
    color: var(--vq-text);
    background: var(--vq-bg);
    border: 1px solid #dce3ec;
    border-radius: 12px;
    padding: 18px;
}

#vietqr-embed .vietqr-wrap {
    max-width: 1160px;
    margin: 0 auto;
}

#vietqr-embed .vietqr-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(360px, 1fr);
    gap: 24px;
    align-items: stretch;
}

#vietqr-embed .vietqr-panel {
    background: #fff;
    border: 1px solid #dde5ef;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(18, 54, 101, 0.05);
    padding: 20px;
    height: 100%;
}

#vietqr-embed .vqg-panel-title {
    margin: 0;
    font-size: 20px !important;
    line-height: 28px !important;
    font-weight: 500 !important;
    letter-spacing: 0;
    color: #112d55;
    font-family: 'Roboto', sans-serif !important;
}

#vietqr-embed .vietqr-sub {
    margin: 4px 0 14px;
    color: var(--vq-muted);
    font-size: 14px !important;
    line-height: 20px !important;
    font-family: 'Roboto', sans-serif !important;
}

#vietqr-embed #vqg-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#vietqr-embed .vq-field-wrap {
    position: relative;
}

#vietqr-embed .vq-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px !important;
    line-height: 20px !important;
    font-weight: 500 !important;
    color: #203d68;
    font-family: 'Roboto', sans-serif !important;
}

#vietqr-embed .form-control,
#vietqr-embed .dropdown-selected {
    width: 100%;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--vq-line);
    border-radius: 0;
    color: #1a355e;
    font-size: 16px !important;
    line-height: 20px !important;
    font-weight: 400 !important;
    padding: 6px 0 8px !important;
    transition: border-color .2s ease, box-shadow .2s ease;
    outline: 0;
    font-family: 'Roboto', sans-serif !important;
}

#vietqr-embed .form-control:focus,
#vietqr-embed .dropdown-wrap.open .dropdown-selected {
    border-bottom: 2px solid var(--vq-primary-2);
    box-shadow: 0 1px 0 rgba(31, 119, 216, 0.15);
}

#vietqr-embed .uppercase {
    text-transform: uppercase;
}

#vietqr-embed .char-counter {
    position: absolute;
    right: 0;
    bottom: -15px;
    font-size: 12px;
    color: #7f93af;
}

#vietqr-embed .custom-dropdown {
    position: relative;
}

#vietqr-embed .dropdown-selected {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#vietqr-embed .dropdown-selected .selected-text {
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100% - 20px);
}

#vietqr-embed .dropdown-selected .caret {
    font-size: 12px;
    color: #5f7faa;
}

#vietqr-embed .dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    border: 1px solid #d8e2ee;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 20px 45px rgba(17, 45, 85, 0.17);
    z-index: 100;
}

#vietqr-embed .dropdown-search-wrap {
    padding: 10px 12px;
    border-bottom: 1px solid #edf2f8;
}

#vietqr-embed #vqg-bank-search {
    font-size: 14px;
    padding-bottom: 8px;
}

#vietqr-embed .dropdown-items-list {
    max-height: 300px;
    overflow: auto;
}

#vietqr-embed .bank-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 9px 12px;
    border-bottom: 1px solid #f2f5f9;
    cursor: pointer;
}

#vietqr-embed .bank-item:hover {
    background: #f4f9ff;
}

#vietqr-embed .bank-logo-mini {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

#vietqr-embed .bank-fn {
    font-size: 11px;
    color: #7d8da6;
}

#vietqr-embed .vq-toggle-row {
    margin: -3px 0 2px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#vietqr-embed .switch {
    position: relative;
    width: 42px;
    height: 24px;
    flex: 0 0 42px;
}

#vietqr-embed .switch input { display: none; }

#vietqr-embed .slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #ccd6e4;
    transition: background .2s ease;
}

#vietqr-embed .slider:before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
    transition: transform .2s ease;
}

#vietqr-embed .switch input:checked + .slider {
    background: #1f77d8;
}

#vietqr-embed .switch input:checked + .slider:before {
    transform: translateX(18px);
}

#vietqr-embed .toggle-label {
    color: #4d668b;
    font-size: 13px !important;
}

#vietqr-embed .vq-extra-trigger {
    margin-top: 2px;
    color: #53719a;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
}

#vietqr-embed .vq-extra-trigger .arrow {
    transition: transform .2s ease;
}

#vietqr-embed .vq-extra-fields {
    display: none;
    padding-top: 4px;
}

#vietqr-embed .vq-extra-fields.show {
    display: block;
}

#vietqr-embed .vq-extra-fields.show + * {
    margin-top: 0;
}

#vietqr-embed .vq-captcha-row {
    margin-top: 6px;
}

#vietqr-embed .vq-captcha-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

#vietqr-embed .vq-q-badge {
    min-width: 108px;
    text-align: center;
    background: #dbe8fb;
    color: #1e4f92;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 16px;
    font-weight: 700;
}

#vietqr-embed .vq-a-input {
    width: 82px;
    border: 1px solid #cad8ea;
    border-radius: 10px;
    background: #fff;
    padding: 7px 10px;
    font-size: 20px;
    color: #19365f;
    outline: none;
}

#vietqr-embed .vq-a-input:focus {
    border-color: #2a7fe0;
    box-shadow: 0 0 0 3px rgba(42, 127, 224, 0.16);
}

#vietqr-embed .vq-refresh-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #c7d7ea;
    background: #fff;
    color: #2a67ae;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

#vietqr-embed .vq-refresh-btn.spin {
    animation: vq-spin .5s linear;
}

@keyframes vq-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

#vietqr-embed .vq-agree-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #3b5e8d;
    font-size: 14px;
}

#vietqr-embed .vq-agree-check label {
    cursor: pointer;
}

#vietqr-embed .btn-primary-official {
    width: 100%;
    margin-top: 2px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(90deg, #0f53a3 0%, #1f79d8 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    padding: 12px 16px;
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(19, 81, 153, 0.2);
    transition: transform .2s ease, box-shadow .2s ease;
}

#vietqr-embed .btn-primary-official:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(19, 81, 153, 0.27);
}

#vietqr-embed .btn-primary-official:disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

#vietqr-embed .btn-loader {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    display: none;
    animation: vq-spin .7s linear infinite;
}

#vietqr-embed .error-message {
    display: none;
    margin-top: 8px;
    color: var(--vq-danger);
    background: #fdf0f1;
    border: 1px solid #f4c3c7;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
}

#vietqr-embed .vietqr-preview-panel {
    position: sticky;
    top: 18px;
    display: flex;
    flex-direction: column;
}

#vietqr-embed .vietqr-result-container {
    border: 1px dashed #cedaed;
    border-radius: 14px;
    padding: 12px;
    background: #f7fafe;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

#vietqr-embed .vietqr-preview-placeholder {
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #6a80a0;
    font-size: 14px;
}

#vietqr-embed .preview-frame {
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid #b7c9e4;
    background: #fff;
}

#vietqr-embed .preview-frame img {
    width: 100%;
    height: auto;
    display: block;
}

#vietqr-embed .preview-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    margin-top: auto;
}

#vietqr-embed .preview-btn {
    flex: 1;
    border: 1px solid #0f53a3;
    background: #0f53a3;
    color: #fff;
    border-radius: 8px;
    min-height: 40px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
    font-family: 'Roboto', sans-serif !important;
}

#vietqr-embed .preview-btn:hover {
    background: #1b6dcd;
    border-color: #1b6dcd;
}

#vietqr-embed .vietqr-toast {
    display: none;
    position: fixed;
    right: 20px;
    top: 20px;
    z-index: 99999;
    background: #138a48;
    color: #fff;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(0,0,0,.16);
}

@media (max-width: 1090px) {
    #vietqr-embed .vietqr-grid {
        grid-template-columns: 1fr;
    }

    #vietqr-embed .vietqr-preview-panel {
        position: static;
        order: -1;
    }

    #vietqr-embed .preview-actions {
        flex-wrap: wrap;
    }

    #vietqr-embed .preview-btn {
        min-width: calc(50% - 4px);
        flex: 1 1 calc(50% - 4px);
    }
}

@media (max-width: 768px) {
    #vietqr-embed {
        padding: 12px;
    }

    #vietqr-embed .vietqr-panel {
        padding: 14px;
    }

    #vietqr-embed .vqg-panel-title {
        font-size: 20px !important;
    }

    #vietqr-embed .form-control,
    #vietqr-embed .dropdown-selected {
        font-size: 16px !important;
    }
}

#vietqr-embed .vqg-auth-box {
    margin-bottom: 16px;
}

#vietqr-embed .vqg-auth-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
}

#vietqr-embed .vqg-auth-alert.danger {
    background-color: #fde8e8;
    color: #9b1c1c;
    border: 1px solid #f8b4b4;
}

#vietqr-embed .vqg-auth-alert.info {
    background-color: #e1effe;
    color: #1e429f;
    border: 1px solid #a4cafe;
}

#vietqr-embed .vqg-auth-status.success {
    padding: 10px 14px;
    background-color: #def7ec;
    color: #03543f;
    border: 1px solid #84e1bc;
    border-radius: 8px;
    font-size: 14px;
}

#vietqr-embed .vqg-auth-status a {
    color: #03543f;
    text-decoration: underline;
    margin-left: 8px;
    font-weight: 600;
}

#vietqr-embed .vqg-auth-card-block {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 32px 24px;
    text-align: center;
    max-width: 480px;
    margin: 20px auto;
}

#vietqr-embed .vqg-auth-card-block h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: #1f2937;
}

#vietqr-embed .vqg-auth-card-block p {
    color: #4b5563;
    font-size: 14px;
    margin-bottom: 20px;
}

#vietqr-embed .vqg-gsi-center {
    display: flex;
    justify-content: center;
}
