/* === RESET & BASE === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--layout-font-family, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif);
  background: #f5f5f7;
  color: #1d1d1f;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

:root {
  --layout-glass-control-bg: rgba(255, 255, 255, 0.2);
  --layout-glass-control-hover-bg: rgba(255, 255, 255, 0.24);
  --layout-liquid-glass-shadow:
    rgba(242, 242, 242, 0.8) 2px 2px 3px -3px inset,
    rgba(242, 242, 242, 0.8) -2px -2px 3px -3px inset,
    rgba(255, 255, 255, 0.8) -3px -3px 0.8px -3.5px inset,
    rgba(255, 255, 255, 0.8) 3px 3px 0.8px -3.5px inset,
    rgba(0, 0, 0, 0.1) 0 0 8px 0;
}

.footer {
  margin-top: 34px;
}

        .container {
            width: min(100%, 1060px);
            max-width: 1060px;
            margin: 42px auto 56px;
            padding: 0 clamp(14px, 3vw, 24px);
            overflow-x: clip;
        }

        .grid {
            display: grid;
            grid-template-columns: minmax(320px, 440px) minmax(380px, 480px);
            gap: clamp(28px, 4vw, 48px);
            align-items: start;
            justify-content: center;
        }

        @media (max-width: 768px) {
            .container {
              width: 100%;
              margin: 8px auto 24px;
              padding: 0 22px;
          }
        }

        /* Form Section */
        .form-section {
            background: #fff;
            border-radius: 18px;
            padding: clamp(40px, 4vw, 54px) clamp(22px, 3vw, 30px) clamp(24px, 3vw, 34px);
            box-shadow: 0 4px 6px rgba(0,0,0,0.05);
            position: relative;
            top: auto;
            min-width: 0;
            width: 100%;
        }

        .form-title {
            font-size: 40px;
            font-weight: 600;
            background: linear-gradient(90deg, #0084ff 30%, #ff6600 60%);
 			-webkit-background-clip: text;
			-webkit-text-fill-color: transparent;
  			text-shadow: 0 0 70px rgba(255, 159, 64, 0.9);
            margin: 0 0 10px;
            letter-spacing: 0;
            line-height: 1.24;
            text-align: center;
        }

        .form-subtitle {
            font-size: 17px;
            color: #86868b;
            margin: 0 0 42px;
            text-align: center;
            line-height: 1.45;
        }

        .input-group {
            margin-bottom: 24px;
        }

        .input-label {
            display: block;
            font-size: 15px;
            font-weight: 600;
            color: #1d1d1f;
            margin-bottom: 12px;
            text-align: center;
        }

        .input-with-icon {
            position: relative;
            width: 100%;
            border-radius: 999px;
            overflow: hidden;
            transition: transform 0.24s ease;
        }

        .input-with-icon::before {
            content: "";
            position: absolute;
            inset: 0;
            z-index: 1;
            border-radius: inherit;
            background:
                linear-gradient(180deg, rgba(247,248,250,0.72), rgba(232,234,238,0.46) 48%, rgba(220,223,229,0.34)),
                linear-gradient(180deg, rgba(255,255,255,0.16), transparent 22%);
            box-shadow:
                0 12px 24px rgba(120, 128, 140, 0.14),
                0 3px 8px rgba(120, 128, 140, 0.1),
                inset 0 -8px 14px rgba(136, 143, 155, 0.1),
                inset 0 1px 10px rgba(255,255,255,0.16);
            backdrop-filter: blur(18px) saturate(145%);
            -webkit-backdrop-filter: blur(18px) saturate(145%);
            pointer-events: none;
            transition: background 0.24s ease, box-shadow 0.24s ease, transform 0.24s ease;
        }

        .input-with-icon:focus-within::before {
            background:
                linear-gradient(180deg, rgba(248,249,251,0.78), rgba(236,238,242,0.58) 52%, rgba(226,229,235,0.44)),
                linear-gradient(180deg, rgba(255,255,255,0.24), transparent 24%);
            box-shadow:
                0 18px 38px rgba(120, 128, 140, 0.18),
                0 6px 14px rgba(120, 128, 140, 0.14),
                inset 0 -8px 14px rgba(136, 143, 155, 0.05),
                inset 0 1px 14px rgba(255,255,255,0.62);
            backdrop-filter: blur(22px) saturate(170%);
            -webkit-backdrop-filter: blur(22px) saturate(170%);
            transform: translateY(-1px);
        }

        .input-with-icon:hover {
            transform: translateY(-1px);
        }

        .input-field {
            position: relative;
            z-index: 2;
            width: 100%;
            min-height: 58px;
            padding: 16px 18px;
            font-size: 17px;
            border: 0;
            border-radius: 999px;
            background: transparent;
            color: #1d1d1f;
            transition: color 0.2s ease;
            outline: none;
            -webkit-appearance: none;
            appearance: none;
        }

        .input-field::placeholder {
            color: rgba(29, 29, 31, 0.52);
        }

        .input-field:focus {
            color: #111113;
        }

        .btn-primary {
            width: 100%;
            padding: 16px;
            font-size: 17px;
            font-weight: 600;
            color: #fff;
            background:
                linear-gradient(180deg, rgba(0, 122, 255, 0.9), rgba(0, 113, 227, 0.78)),
                var(--layout-glass-control-bg);
            border: none;
            border-radius: 999px;
            cursor: pointer;
            box-shadow: var(--layout-liquid-glass-shadow);
            backdrop-filter: blur(8px) saturate(160%);
            -webkit-backdrop-filter: blur(8px) saturate(160%);
            transition: all 0.2s ease;
            min-height: 54px;
        }

        .btn-primary:hover {
            background:
                linear-gradient(180deg, rgba(0, 128, 255, 0.96), rgba(0, 119, 237, 0.88)),
                var(--layout-glass-control-hover-bg);
            transform: translateY(-1px);
        }

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

        /* Results Section */
        .results-section {
            position: relative;
            display: grid;
            place-items: center;
            min-height: 220px;
            min-width: 0;
            isolation: isolate;
        }

        #result {
            width: 100%;
            min-width: 0;
        }

        .loading {
            display: none;
            justify-content: center;
            align-items: center;
            padding: 60px 20px;
        }

        .spinner {
            width: 40px;
            height: 40px;
            border: 3px solid #d2d2d7;
            border-top-color: #0071e3;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }

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

        .empty-state {
            width: 100%;
            text-align: center;
            padding: 48px 20px;
            color: #86868b;
        }

        .empty-state svg {
            width: 80px;
            height: 80px;
            margin-bottom: 24px;
            opacity: 0.5;
        }

        .empty-state h3 {
            font-size: 24px;
            font-weight: 600;
            color: #1d1d1f;
            margin-bottom: 8px;
        }

        .empty-state p {
            font-size: 17px;
        }

        .order-card {
            background: #fff;
            border-radius: 18px;
            padding: clamp(22px, 3vw, 30px);
            box-shadow: 0 4px 6px rgba(0,0,0,0.05);
            margin-bottom: 20px;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
            min-width: 0;
        }

        .order-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 16px rgba(0,0,0,0.08);
        }

        .status-badge {
            display: inline-block;
            padding: 5px 12px;
            font-size: 14px;
            font-weight: 650;
            border-radius: 999px;
            margin-bottom: 20px;
        }

        .status-success {
            background: #e8f5e9;
            color: #2e7d32;
        }

        .status-pending {
            background: #e3f2fd;
            color: #1976d2;
        }

        .status-warning {
            background: #fff3e0;
            color: #f57c00;
        }

        .order-details {
            display: grid;
            gap: 20px;
        }

        .detail-row {
            display: flex;
            justify-content: space-between;
            padding-bottom: 16px;
            border-bottom: 1px solid #f5f5f7;
        }

        .detail-row:last-child {
            border-bottom: none;
            padding-bottom: 0;
        }

        .detail-label {
            font-size: 15px;
            color: #86868b;
            font-weight: 500;
        }

        .detail-value {
            font-size: 15px;
            color: #1d1d1f;
            font-weight: 500;
            text-align: right;
            max-width: 60%;
            word-break: break-word;
        }

        .order-note-card {
            margin-top: 20px;
            padding: 14px 16px;
            background: #f5f5f7;
            border: 0;
            border-radius: 18px;
            text-align: center;
        }

        .order-note-text {
            display: block;
            color: #1d1d1f;
            font-size: 15px;
            font-weight: 600;
            line-height: 1.45;
            word-break: break-word;
        }

        .order-note-card.note-pending .order-note-text {
            color: #0071e3;
        }

        .order-note-card.note-warning .order-note-text {
            color: #f57c00;
        }

        .order-note-card.note-danger .order-note-text {
            color: #d32f2f;
        }

        .order-note-card.note-success .order-note-text {
            color: #34c759;
        }

        .cert-actions {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 12px;
            margin-top: 24px;
        }

        .btn-download,
        .btn-install-esign {
            min-height: 48px;
            padding: 12px 18px;
            font-size: 15px;
            font-weight: 600;
            color: #1d1d1f;
            border: none;
            border-radius: 999px;
            text-decoration: none;
            transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            box-shadow: var(--layout-liquid-glass-shadow);
            backdrop-filter: blur(8px) saturate(160%);
            -webkit-backdrop-filter: blur(8px) saturate(160%);
        }

        .btn-download {
            background: var(--layout-glass-control-bg);
            color: #1d1d1f;
        }

        .btn-download:hover {
            background: var(--layout-glass-control-hover-bg);
            color: #007aff;
            transform: translateY(-1px);
        }

        .btn-install-esign {
            background:
                linear-gradient(180deg, rgba(0, 122, 255, 0.9), rgba(0, 113, 227, 0.78)),
                var(--layout-glass-control-bg);
            color: #fff;
            letter-spacing: 0;
            font-weight: 600;
            font-size: 15px;
        }

        .btn-install-esign:hover {
            background:
                linear-gradient(180deg, rgba(0, 128, 255, 0.96), rgba(0, 119, 237, 0.88)),
                var(--layout-glass-control-hover-bg);
            transform: translateY(-1px);
        }

        .btn-download:active,
        .btn-install-esign:active {
            transform: scale(0.98);
        }

        .btn-install-esign.show-progress {
            gap: 10px;
            background: #0071e3;
        }

        .btn-install-esign.show-progress::before {
            content: "";
            width: 16px;
            height: 16px;
            border: 2px solid rgba(255, 255, 255, 0.35);
            border-top-color: #fff;
            border-radius: 50%;
            animation: spin 0.6s linear infinite;
            flex: 0 0 16px;
        }

        .btn-install-esign.show-progress.error {
            background: #ff3b30;
        }

        .btn-install-esign.disabled {
            cursor: not-allowed;
        }

        .notfound {
            text-align: center;
            width: 100%;
            padding: clamp(22px, 3vw, 30px);
            background: #fff;
            border-radius: 18px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.05);
        }

        .notfound h2 {
            font-size: 24px;
            color: #86868b;
            font-weight: 500;
        }

        @media (max-width: 1023px) {
            .grid {
                grid-template-columns: minmax(0, 1fr);
                gap: 18px;
            }

            .form-section,
            .order-card {
                border-radius: 22px;
            }
        }

        @media (max-width: 640px) {
            .container {
                padding: 0 18px;
            }

            .form-section {
                padding: 30px 16px 16px;
                border-radius: 18px;
            }

            .order-card {
                padding: 16px;
                border-radius: 18px;
            }

            .form-title {
                font-size: 36px;
            }

            .cert-actions {
                grid-template-columns: 1fr;
            }

        }
