/* ===============================
   Advanced Auth Scoped Reset
================================= */

.advance-auth-wrapper {
    /* all: revert; */
}

.advance-auth-form,
.advance-auth-form * {
    box-sizing: border-box;
}
.tooltip-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.custom-tooltip {
    position: absolute;
    bottom: 110%;
    right: 0;
    width: 362px;
    background: #420435;
    color: #fff;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.6;
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 8px 25px rgba(0,0,0,0.25);
    z-index: 10;
}

.custom-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 15px;
    border-width: 6px;
    border-style: solid;
    border-color: #420435 transparent transparent transparent;
}

.tooltip-wrapper:hover .custom-tooltip {
    opacity: 1;
    visibility: visible;
}
.advance-auth-form {
    font-family: 'iransans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    direction: rtl;
    width: 100%;
    max-width: 420px;
    margin: 40px auto;
    background: #ffffff;
    padding: 28px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    border: 1px solid #eee;
}

/* برگردوندن display برای المان‌های ضروری */
.advance-auth-form form,
.advance-auth-form div,
.advance-auth-form label,
.advance-auth-form input,
.advance-auth-form button {
    box-sizing: border-box;
    display: block;
    width: 100%;
}
.advance-auth-field label small {
  color: blue;
  font-size: 10px;
  font-weight: normal;
}
.card_number {
  text-align: left;
  direction: ltr;
  letter-spacing: 5px;
}
.advance-auth-field.auth-field-unvisible {
  height: 0;
  overflow: hidden;
  opacity: 0;
  margin: 0 !important;
  padding: 0 !important;
}
.birthdate-select-group select {
  width: 32%;
}
.birthdate-select-group {
  display: flex !important;
  justify-content: space-between !important;
}
.card-field-group {
  display: flex !important;
  position: relative;
}
.remove-card {
  position: absolute;
  width: 49px !important;
  right: 0;
  height: 100%;
}
#add_card {
  margin-bottom: 14px;
  width: auto;
  margin-right: auto;
  border: 0;
  background: #ffbf00;
  border-radius: 5px;
}
#add_card:hover {
    background: #4f46e5;
}
.remove-card:hover {
  background: #ccc;
  color: #000;
}
.advance-auth-card-field {
  margin-bottom: 14px;
}
/* ===============================
   Fields
================================= */

.advance-auth-field {
    margin-bottom: 18px !important;
}

.advance-auth-field label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #444;
}

.advance-auth-field input {
    height: 44px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid #dcdcdc;
    font-size: 14px;
    background: #fafafa;
    transition: all 0.2s ease;
}

.advance-auth-field input:focus {
    border-color: #4f46e5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
    outline: none;
}

/* ===============================
   Button
================================= */

.advance-auth-submit {
    margin-top: 10px;
}
.auth-error {
  background: rgb(255, 221, 221);
}
.auth-success {
  background: rgb(221, 255, 236);
}
.advance-auth-submit button {
    height: 46px;
    border-radius: 8px;
    background: #4f46e5;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border: 0;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.advance-auth-submit button:hover {
    background: #4338ca;
}

.advance-auth-submit button:active {
    transform: scale(0.98);
}

.advance-auth-messages {
    margin-bottom: 15px;
    font-size: 13px;
}

.auth-error {
    background: #fee2e2;
    color: #b91c1c;
    padding: 10px;
    border-radius: 8px;
}

.auth-success {
    background: #dcfce7;
    color: #166534;
    padding: 10px;
    border-radius: 8px;
}

/* ==============================
OCR STyle
++++++++++++++++++++ */
.ocr-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.advance-auth-form .ocr-card-box label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.advance-auth-form .ocr-preview {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    height: 223px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #f9fafb;
    transition: 0.3s;
    overflow: hidden;
}

.advance-auth-form .ocr-preview:hover {
    border-color: #2563eb;
    background: #eef2ff;
}

.advance-auth-form .ocr-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.advance-auth-form .ocr-input {
    opacity: 0;
    position: absolute;
}

.advance-auth-form .ocr-card-box {
    position: relative;
    margin-bottom: 20px;
}

.advance-auth-form .ocr-card-box .ocr-preview::after {
    content: "انتخاب تصویر";
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: #2563eb;
    color: #fff;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 6px;
}
.advance-auth-theme-modern {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #f8fafc;
  z-index: 999999999;
  padding: 20px;
}
.advance-auth-theme-modern .advance-auth-wrapper {
    max-width: 800px;
    margin:auto;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-top: 2px solid #3498db;
  border-radius: 50%;
  animation: authspin 0.8s linear infinite;
  vertical-align: middle;
}

.auth-completed-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    background: #f8fafc;
}

.auth-completed-card {
    background: #ffffff;
    padding: 50px 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.08);
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.success-icon {
    font-size: 90px;
    margin-bottom: 20px;
    animation: bounceIn 1s ease, pulse 2s infinite 1s;
}

.auth-completed-card h2 {
    font-size: 22px;
    margin-bottom: 15px;
    color: #16a34a;
}

.redirect-text {
    color: #555;
    margin-bottom: 25px;
}

#countdown {
    font-weight: bold;
    font-size: 18px;
    color: #dc2626;
}

.go-now-btn {
    background: #16a34a;
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.3s ease;
}

.go-now-btn:hover {
    background: #15803d;
    transform: translateY(-2px);
}

.step-completed .advance-auth-cancel.advance-auth-wrapper {
    display: none;
}

/* ===============================
   PRO Step Bar
================================= */

.advance-auth-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 35px;
    position: relative;
    gap: 0;
}

/* خط بین مراحل */
.advance-auth-steps::before {
    content: "";
    position: absolute;
    top: 22px;
    right: 0;
    left: 0;
    height: 4px;
    background: #e5e7eb;
    z-index: 0;
    border-radius: 10px;
}

/* هر استپ */
.advance-auth-steps .step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* دایره شماره */
.advance-auth-steps .step-number {
    width: 44px;
    height: 44px;
    line-height: 44px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #555;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 0 0 4px #fff;
    display: flex;
    justify-content: center;
}

/* عنوان */
.advance-auth-steps .step-label {
    font-size: 13px;
    color: #666;
    display: block;
    transition: 0.3s;
}

/* completed */
.advance-auth-steps .step.completed .step-number {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #fff;
}

.advance-auth-steps .step.completed .step-label {
    color: #16a34a;
    font-weight: 500;
}

/* current */
.advance-auth-steps .step.current .step-number {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(99,102,241,0.15);
}

.advance-auth-steps .step.current .step-label {
    color: #8d86ff;
    font-weight: 600;
}

/* اتصال خط سبز تا استپ completed */
.advance-auth-steps .step.completed::after {
    content: "";
    position: absolute;
    top: 22px;
    right: 0;
    width: 150%;
    height: 4px;
    background: linear-gradient(to left, #22c55e, #16a34a);
    z-index: -1;
}

.advance-auth-cancel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;

    color: #555;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 8px;

    text-decoration: none;
    cursor: pointer;

    transition: all 0.25s ease;
}

/* hover */
.advance-auth-cancel-btn:hover {
    background: #f5f7fa;
    border-color: #bbb;
    color: #222;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.advance-auth-cancel.advance-auth-wrapper p {
  margin-bottom: 9px;
  font-size: 13px;
  color: #777;
}

.woocommerce-info.advance-auth-optional-notice {
  float: right;
  width: 100%;
  margin-top: 25px;
}

/* active click */
.advance-auth-cancel-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* focus accessibility */
.advance-auth-cancel-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.15);
}



/* ===============================
   Dark Mode Manual
================================= */

.advance-auth-style-dark {
    background: #1a1a1a;
    min-height: 100vh;
}

.advance-auth-style-dark .advance-auth-form {
    background: #000;
    border: 1px solid #334155;
    color: #e2e8f0;
}

.advance-auth-style-dark .advance-auth-field label small {
  color: #9d9d9d;
}

.advance-auth-style-dark .advance-auth-steps .step.current {
  border-color: #a00aca;
}

.advance-auth-style-dark .advance-auth-steps .step {
  color: #ccc;
}

.advance-auth-style-dark .advance-auth-field label {
    color: #cbd5e1;
}

.advance-auth-style-dark .advance-auth-field input,
.advance-auth-style-dark .advance-auth-form select,
.advance-auth-style-dark .advance-auth-form input {
    background: #0f172a;
    border: 1px solid #334155;
    color: #f1f5f9;
}

.advance-auth-style-dark #add_card {
    background: #334155;
    color: #e2e8f0;
}

.advance-auth-style-dark #add_card:hover {
    background: #6366f1;
    color: #fff;
}

.advance-auth-style-dark .remove-card {
    background: #7f1d1d;
    color: #fecaca;
    border: none;
}

.advance-auth-style-dark .remove-card:hover {
    background: #991b1b;
    color: #fff;
}

.advance-auth-style-dark .advance-auth-field input:focus,
.advance-auth-style-dark .advance-auth-form select:focus,
.advance-auth-style-dark .advance-auth-form input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.3);
}

.advance-auth-style-dark .advance-auth-submit button {
    background: #6366f1;
}

.advance-auth-style-dark .advance-auth-submit button:hover {
    background: #4f46e5;
}

.advance-auth-style-dark .auth-error {
    background: #7f1d1d;
    color: #fecaca;
}

.advance-auth-style-dark .auth-success {
    background: #064e3b;
    color: #bbf7d0;
}

.advance-auth-style-dark .advance-auth-cancel-btn {
    border-color: #334155;
    color: #cbd5e1;
}

.advance-auth-style-dark .advance-auth-cancel-btn:hover {
    background: #1e293b;
    border-color: #475569;
    color: #fff;
}
.advance-auth-style-dark .advance-auth-form .ocr-preview {
    border: 2px dashed #515151;
    background: rgba(0, 0, 0, 0.259);
}

.advance-auth-style-dark .advance-auth-form .ocr-preview:hover {
  border-color: #2563eb;
  background: #070707;
}


.advance-auth-style-dark .advance-auth-steps::before {
    background: #334155;
}

.advance-auth-style-dark .advance-auth-steps .step-number {
    background: #334155;
    color: #cbd5e1;
    box-shadow: 0 0 0 4px #1e293b;
}

.advance-auth-style-dark .advance-auth-steps .step-label {
    color: #94a3b8;
}

.advance-auth-style-dark .step.completed .step-number {
    background: linear-gradient(135deg, #15803d, #22c55e);
}

.advance-auth-style-dark .step.current .step-number {
    background: linear-gradient(135deg, #818cf8, #6366f1);
    box-shadow: 0 0 0 6px rgba(99,102,241,0.25);
}

.advance-auth-style-dark .step.completed::after {
    background: #22c55e;
}

/* ==================================
   DARK - Completed Screen
================================== */

.advance-auth-style-dark .auth-completed-wrapper {
    background: #0f172a;
}

.advance-auth-style-dark .auth-completed-card {

    background: #000;
    border: 1px solid #334155;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5);
    color: #e2e8f0;
}

.advance-auth-style-dark .auth-completed-card h2 {
    color: #22c55e;
}

.advance-auth-style-dark .redirect-text {
    color: #94a3b8;
}

.advance-auth-style-dark #countdown {
    color: #f87171;
}


/* آیکن */
.advance-auth-style-dark .success-icon {
    filter: drop-shadow(0 0 12px rgba(34,197,94,0.4));
}

/* ===============================
   Auto Mode (System Preference)
================================= */

@media (prefers-color-scheme: dark) {

    .advance-auth-style-auto {
        background: #1a1a1a;
        min-height: 100vh;
    }

    .advance-auth-style-auto .advance-auth-form {
        background: #000;
        border: 1px solid #334155;
        box-shadow: 0 10px 30px rgba(0,0,0,0.4);
        color: #e2e8f0;
    }

    .advance-auth-style-auto .advance-auth-field label {
        color: #cbd5e1;
    }


    .advance-auth-style-auto .advance-auth-field input,
    .advance-auth-style-auto .advance-auth-form select,
    .advance-auth-style-auto .advance-auth-form input {
        background: #0f172a;
        border: 1px solid #334155;
        color: #f1f5f9;
    }

    .advance-auth-style-auto #add_card {
        background: #334155;
        color: #e2e8f0;
    }

    .advance-auth-style-auto #add_card:hover {
        background: #6366f1;
        color: #fff;
    }

    .advance-auth-style-auto .remove-card {
        background: #7f1d1d;
        color: #fecaca;
        border: none;
    }

    .advance-auth-style-auto .remove-card:hover {
        background: #991b1b;
        color: #fff;
    }

    .advance-auth-style-auto .advance-auth-field input:focus,
    .advance-auth-style-auto .advance-auth-form select:focus,
    .advance-auth-style-auto .advance-auth-form input:focus {
        border-color: #6366f1;
        box-shadow: 0 0 0 3px rgba(99,102,241,0.3);
    }

    .advance-auth-style-auto .advance-auth-submit button {
        background: #6366f1;
    }

    .advance-auth-style-auto .advance-auth-submit button:hover {
        background: #4f46e5;
    }

    .advance-auth-style-auto .auth-error {
        background: #7f1d1d;
        color: #fecaca;
    }

    .advance-auth-style-auto .auth-success {
        background: #064e3b;
        color: #bbf7d0;
    }

    .advance-auth-style-auto .advance-auth-cancel-btn {
        border-color: #334155;
        color: #cbd5e1;
    }

    .advance-auth-style-auto .advance-auth-cancel-btn:hover {
        background: #1e293b;
        border-color: #475569;
        color: #fff;
    }

    .advance-auth-style-auto .advance-auth-field label small {
        color: #9d9d9d;
    }

    .advance-auth-style-auto .advance-auth-steps .step.current {
        border-color: #a00aca;
    }

    .advance-auth-style-auto .advance-auth-steps .step {
        color: #ccc;
    }

    .advance-auth-style-auto .advance-auth-form .ocr-preview {
        border: 2px dashed #515151;
        background: rgba(0, 0, 0, 0.259);
    }

    .advance-auth-style-auto .advance-auth-form .ocr-preview:hover {
        border-color: #2563eb;
        background: #070707;
    }

     .advance-auth-style-auto .advance-auth-steps::before {
        background: #334155;
    }

    .advance-auth-style-auto .advance-auth-steps .step-number {
        background: #334155;
        color: #cbd5e1;
        box-shadow: 0 0 0 4px #1e293b;
    }

    .advance-auth-style-auto .advance-auth-steps .step-label {
        color: #94a3b8;
    }

    .advance-auth-style-auto .step.completed .step-number {
        background: linear-gradient(135deg, #15803d, #22c55e);
    }

    .advance-auth-style-auto .step.current .step-number {
        background: linear-gradient(135deg, #818cf8, #6366f1);
        box-shadow: 0 0 0 6px rgba(99,102,241,0.25);
    }

    .advance-auth-style-auto .step.completed::after {
        background: linear-gradient(to left, #22c55e, #15803d);
    }

     .advance-auth-style-auto .auth-completed-wrapper {
        background: #0f172a;
    }

    .advance-auth-style-auto .auth-completed-card {
        background: #000;
        border: 1px solid #334155;
        box-shadow: 0 25px 60px rgba(0,0,0,0.5);
        color: #e2e8f0;
    }

    .advance-auth-style-auto .auth-completed-card h2 {
        color: #22c55e;
    }

    .advance-auth-style-auto .redirect-text {
        color: #94a3b8;
    }

    .advance-auth-style-auto #countdown {
        color: #f87171;
    }

    .advance-auth-style-auto .success-icon {
        filter: drop-shadow(0 0 12px rgba(34,197,94,0.4));
    }

}




/* انیمیشن‌ها */
@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.1); opacity: 1; }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

@keyframes authspin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
      

/* ===============================
   Responsive
================================= */

@media (max-width: 480px) {
    .advance-auth-form {
        padding: 20px;
        margin: 0;
        max-width:100%;
    }
    .advance-auth-steps .step-number {
      width: 20px;
      height: 20px;
      line-height: 22px;
    }
    .advance-auth-steps::before {
        top:10px;
    }
    .advance-auth-steps .step-label {
        font-size: 10px;
    }
}
