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

    body {
      background: linear-gradient(145deg, #e9f1f7 0%, #d4e3ed 100%);
      min-height: 100vh;
      display: flex;
      justify-content: center;
      align-items: center;
      font-family: 'Inter', sans-serif;
      padding: 2rem 1rem;
    }

    .app-container {
      max-width: 1300px;
      width: 100%;
      background: rgba(255, 255, 255, 0.75);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      border-radius: 2.5rem;
      box-shadow: 0 25px 40px -12px rgba(2, 48, 71, 0.25);
      padding: 2rem 2rem 2.5rem;
      border: 1px solid rgba(255, 255, 255, 0.5);
    }

    h1 {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      font-weight: 600;
      font-size: 2.1rem;
      letter-spacing: -0.02em;
      color: #0b3b4f;
      margin-bottom: 0.25rem;
    }

    h1 i {
      color: #1e7e83;
      background: white;
      padding: 0.6rem;
      border-radius: 1.2rem;
      box-shadow: 0 6px 12px rgba(0,0,0,0.04);
    }

    .subhead {
      color: #2a5e6b;
      margin-bottom: 2rem;
      font-weight: 500;
      border-left: 4px solid #2a9d8f;
      padding-left: 1rem;
      font-size: 1rem;
    }

    .two-column {
      display: flex;
      flex-wrap: wrap;
      gap: 2rem;
    }

    /* LEFT PANEL — FORM */
    .form-panel {
      flex: 1 1 380px;
      background: white;
      border-radius: 2rem;
      padding: 1.8rem 1.8rem 2.2rem;
      box-shadow: 0 12px 28px -8px rgba(0, 55, 70, 0.12);
      border: 1px solid rgba(42, 157, 143, 0.15);
    }

    .form-panel h2 {
      display: flex;
      align-items: center;
      gap: 0.6rem;
      font-weight: 600;
      font-size: 1.4rem;
      color: #1e5f6b;
      margin-bottom: 1.8rem;
    }

    .form-panel h2 i {
      color: #2a9d8f;
    }

    .input-group {
      margin-bottom: 1.5rem;
    }

    label {
      display: block;
      font-weight: 600;
      font-size: 0.85rem;
      text-transform: uppercase;
      letter-spacing: 0.03em;
      color: #386a77;
      margin-bottom: 0.4rem;
    }

    label i {
      margin-right: 6px;
      width: 1.1rem;
      color: #2a9d8f;
    }

    input, textarea, select {
      width: 100%;
      padding: 0.9rem 1.2rem;
      font-family: 'Inter', sans-serif;
      font-size: 1rem;
      background: #f9fcfd;
      border: 1.5px solid #d7e4e8;
      border-radius: 20px;
      transition: all 0.2s;
      color: #153e4b;
      font-weight: 500;
    }

    textarea {
      min-height: 85px;
      resize: vertical;
    }

    input:focus, textarea:focus, select:focus {
      outline: none;
      border-color: #2a9d8f;
      box-shadow: 0 0 0 4px rgba(42, 157, 143, 0.15);
      background: white;
    }

    .row-2col {
      display: flex;
      gap: 1rem;
      flex-wrap: wrap;
    }

    .row-2col .input-group {
      flex: 1 1 0;
    }

    /* doctor signature style inline */
    .signature-preview {
      margin-top: 0.5rem;
      font-style: italic;
      color: #1a5f68;
      background: #eef5f4;
      padding: 0.5rem 1rem;
      border-radius: 16px;
      font-size: 0.9rem;
    }

    .btn {
      background: #1e7e83;
      color: white;
      border: none;
      padding: 1rem 1.8rem;
      font-weight: 600;
      font-size: 1.1rem;
      border-radius: 40px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.6rem;
      cursor: pointer;
      transition: 0.15s;
      box-shadow: 0 8px 18px rgba(30, 126, 131, 0.25);
      border: 1px solid #489ea2;
      width: 100%;
      letter-spacing: 0.3px;
    }

    .btn i {
      font-size: 1.1rem;
    }

    .btn:hover {
      background: #0f5e62;
      transform: scale(1.01);
      box-shadow: 0 12px 22px rgba(15, 94, 98, 0.3);
    }

    .btn-outline {
      background: transparent;
      color: #1e5f6b;
      box-shadow: none;
      border: 2px solid #b6d4d2;
      margin-top: 0.8rem;
      box-shadow: none;
    }

    .btn-outline:hover {
      background: #eaf3f1;
      border-color: #2a9d8f;
      color: #0b3b4f;
      box-shadow: none;
    }

    /* RIGHT PANEL — CERTIFICATE PREVIEW */
    .cert-panel {
      flex: 2 1 550px;
      background: #fbfdff;
      border-radius: 2rem;
      padding: 1.8rem 1.8rem 2rem;
      box-shadow: inset 0 0 0 1px rgba(255,255,255,0.9), 0 15px 30px -10px rgba(0,40,50,0.1);
      border: 1px solid #cbdde3;
    }

    .cert-header-actions {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 1.2rem;
    }

    .cert-header-actions h3 {
      font-weight: 600;
      color: #153e4b;
      display: flex;
      gap: 8px;
      font-size: 1.2rem;
    }

    .certificate {
      background: #ffffff;
      padding: 2rem 2.2rem 2.5rem;
      border-radius: 28px;
      box-shadow: 0 0 0 2px #f0ebe4, 0 20px 30px -10px rgba(21, 62, 75, 0.15);
      border: 6px double #baced4;
      transition: all 0.1s ease;
      position: relative;
      overflow: hidden;
    }

    /* decorative watermark */
    .certificate::before {
      content: "⚕️";
      font-size: 14rem;
      position: absolute;
      bottom: -30px;
      right: -10px;
      opacity: 0.04;
      transform: rotate(10deg);
      pointer-events: none;
      font-family: "Segoe UI Emoji", sans-serif;
    }

    .cert-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 2px solid #b7cfd6;
      padding-bottom: 1rem;
      margin-bottom: 1.8rem;
    }

    .clinic-name {
      font-family: 'Playfair Display', serif;
      font-weight: 700;
      font-size: 1.9rem;
      color: #073b47;
      letter-spacing: -0.5px;
    }

    .clinic-name i {
      color: #1e7e83;
      margin-right: 8px;
    }

    .cert-badge {
      background: #e6f3ef;
      padding: 0.4rem 1.2rem;
      border-radius: 40px;
      color: #0b5e68;
      font-weight: 600;
      font-size: 0.9rem;
      border: 1px dashed #2a9d8f;
    }

    .cert-title {
      text-align: center;
      margin: 1.8rem 0 1.8rem;
    }

    .cert-title h2 {
      font-size: 2.5rem;
      font-weight: 600;
      letter-spacing: 3px;
      color: #164a57;
      text-transform: uppercase;
      font-family: 'Playfair Display', serif;
      border-bottom: 2px dotted #aac7cf;
      display: inline-block;
      padding-bottom: 10px;
    }

    .patient-details {
      margin: 1.5rem 0 2rem;
    }

    .detail-row {
      display: flex;
      margin-bottom: 0.9rem;
      font-size: 1.1rem;
    }

    .detail-label {
      width: 120px;
      font-weight: 600;
      color: #1f5e6b;
    }

    .detail-value {
      font-weight: 500;
      color: #0a2f3b;
      border-bottom: 1px dashed #b1cbd3;
      padding-bottom: 3px;
      flex: 1;
    }

    .diagnosis-section {
      background: #f6fbfd;
      padding: 1.2rem 1.5rem;
      border-radius: 20px;
      margin: 1.8rem 0;
    }

    .diagnosis-text {
      font-size: 1.1rem;
      line-height: 1.5;
    }

    .footer-cert {
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
      margin-top: 2.2rem;
      padding-top: 0.8rem;
    }

    .doctor-signature {
      text-align: left;
    }

    .doctor-name {
      font-weight: 700;
      font-size: 1.3rem;
      color: #073b47;
      font-family: 'Playfair Display', serif;
    }

    .signature-line {
      margin-top: 8px;
      border-top: 2px solid #2a9d8f;
      width: 200px;
      padding-top: 6px;
      color: #386a77;
      font-size: 0.9rem;
    }

    .issue-date {
      color: #2b6675;
      font-weight: 500;
    }

    .placeholder-dim {
      opacity: 0.6;
      font-style: italic;
    }

    .action-buttons {
      display: flex;
      gap: 10px;
      margin-top: 1.2rem;
    }
    .action-buttons .btn {
      width: auto;
      padding: 0.8rem 1.5rem;
    }

    /* small */
    .small-note {
      font-size: 0.8rem;
      color: #4d757f;
      margin-top: 0.5rem;
    }