#form {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 20px;
    background: rgba(13, 42, 76, 0.7);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    display: none; /* Initially hidden */
    justify-content: center;
    align-items: flex-start;
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Modal Animation States */
#form.modal-opening {
    opacity: 1;
}

#form.modal-closing {
    opacity: 0;
}

/* Modal Content Animation */
#form.modal-opening .modal-content {
    transform: translateY(0);
}

#form.modal-closing .modal-content {
    transform: translateY(-20px);
}

/* Modal wrapper */
.modal {
    width: 100%;
    max-width: 1200px;
  margin: auto;
  display: flex;
  align-items: center;
  min-height: 100%;
}

.modal-content {
    background: var(--blue-50);
    border-radius: 16px;
    display: flex;
    flex-direction: row;
    gap: 30px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    width: 100%;
    margin: 20px 0;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

/* Left side (form) */
.modal-left {
    flex: 1 1 60%;
}

.modal-left h2 {
    font-size: var(--h3);
    font-weight: 700;
    color: var(--blue-600);
    margin-bottom: 15px;
}

.modal-left p {
    font-size: var(--body);
    color: var(--text-color);
    margin-bottom: 20px;
    line-height: 1.6;
}

.two-col {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.two-col input {
    flex: 1;
}

input,
textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: var(--body);
    border: 1px solid var(--blue-100);
    border-radius: 6px;
    outline: none;
    font-family: var(--font-family);
}

textarea {
    resize: vertical;
    min-height: 100px;
    margin-bottom: 15px;
}

#telegram-teams-id {
    margin-bottom: 15px;
}

input:focus,
textarea:focus {
    border-color: var(--blue-500);
}

/* Error state for required fields */
input.error,
textarea.error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

input.error:focus,
textarea.error:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* Success Toast Notification */
.success-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 4px 6px rgba(0, 0, 0, 0.07);
    border-left: 4px solid #10b981;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    max-width: 400px;
    min-width: 300px;
    z-index: 9999;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-family);
}

.success-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.success-toast.hiding {
    transform: translateX(100%);
    opacity: 0;
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.toast-icon i {
    font-size: 24px;
    color: #10b981;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-content h4 {
    margin: 0 0 4px 0;
    font-size: var(--body);
    font-weight: 600;
    color: var(--heading-color);
    line-height: 1.4;
}

.toast-content p {
    margin: 0;
    font-size: var(--small);
    color: var(--text-color);
    line-height: 1.5;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    color: #9ca3af;
    transition: all 0.2s ease;
    margin-top: 2px;
}

.toast-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.toast-close i {
    font-size: 16px;
}

/* Toast Tablet Responsiveness */
@media (max-width: 1024px) and (min-width: 768px) {
  .success-toast {
    top: 18px;
    right: 18px;
    max-width: 350px;
    min-width: 280px;
  }
}

/* Toast Small Mobile */
@media (max-width: 480px) {
  .success-toast {
    top: 12px;
    right: 12px;
    left: 12px;
    padding: 12px 14px;
    gap: 8px;
    border-radius: 8px;
  }

  .toast-content h4 {
    font-size: var(--small);
    margin-bottom: 2px;
  }

  .toast-content p {
    font-size: var(--small);
    line-height: 1.3;
  }

  .toast-icon {
    width: 20px;
    height: 20px;
  }

  .toast-icon i {
    font-size: 18px;
  }

  .toast-close {
    width: 16px;
    height: 16px;
  }

  .toast-close i {
    font-size: 12px;
  }
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 5px;
}

.btn-primary,
.btn-outline {
    flex: 1;
    padding: 12px 0;
    font-size: var(--body);
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--blue-500);
    color: #fff;
    border: none;
}

.btn-primary:hover {
    background: var(--blue-600);
}

.btn-outline {
    background: transparent;
    color: var(--blue-500);
    border: 2px solid var(--blue-500);
}

.btn-outline:hover {
    background: var(--blue-50);
}

/* Right side (contacts) */
.modal-right {
    flex: 1 1 40%;
    background: #ffffff;
    border-radius: 16px;
    padding: 25px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    position: relative;
}

.modal-right h3 {
    font-size: var(--h4);
    font-weight: 700;
    color: var(--heading-color);
    margin-bottom: 20px;
    text-align: center;
    position: relative;
}

.modal-right h3::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background: var(--blue-500);
  border-radius: 2px;
}

.contact-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.contact-list li {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    transition: all 0.3s ease;
    position: relative;
}

.contact-list li:hover {
  background: #f1f5f9;
  border-color: var(--blue-300);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.1);
}

.contact-list i {
    font-size: 24px;
  color: var(--blue-500);
    flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-50);
  border-radius: 10px;
  border: 1px solid var(--blue-200);
  transition: all 0.3s ease;
}

.contact-list li:hover i {
  background: var(--blue-500);
  color: white;
  transform: scale(1.05);
  border-color: var(--blue-500);
}

.contact-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-label {
  font-size: var(--small);
  color: var(--blue-600);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.contact-value {
  font-size: var(--body);
  color: var(--text-color);
  font-weight: 500;
  line-height: 1.5;
}

.contact-value a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.contact-value a:hover {
  color: var(--blue-600);
}

/* Responsive Breakpoints */

/* Large Desktop */
@media (min-width: 1440px) {
    #form {
        padding: 30px;
    }
    
    .modal-content {
        gap: 35px;
        padding: 35px;
    }
    
    .modal-left h2 {
        font-size: var(--h2);
        margin-bottom: 18px;
    }
    
    .modal-left p {
        font-size: var(--large);
        margin-bottom: 25px;
    }
    
    .modal-right {
        padding: 30px;
    }
    
    .modal-right h3 {
        font-size: var(--h3);
        margin-bottom: 22px;
    }
    
    .contact-list li {
        padding: 18px 20px;
    }
    
    .contact-list i {
        font-size: 28px;
        width: 36px;
        height: 36px;
    }
    
    .contact-value {
        font-size: var(--large);
    }
}

/* Desktop */
@media (max-width: 1439px) and (min-width: 1200px) {
    #form {
        padding: 20px;
    }
    
    .modal-content {
        gap: 30px;
        padding: 32px;
    }
    
    .modal-left h2 {
        font-size: var(--h3);
        margin-bottom: 16px;
    }
    
    .modal-left p {
        font-size: var(--body);
        margin-bottom: 22px;
    }
}

/* Small Desktop */
@media (max-width: 1199px) and (min-width: 1024px) {
    #form {
        padding: 18px;
    }
    
    .modal-content {
        gap: 28px;
        padding: 30px;
    }
    
    .modal-left h2 {
        font-size: var(--h3);
        margin-bottom: 15px;
    }
}

/* Tablet Landscape */
@media (max-width: 1023px) and (min-width: 768px) {
    #form {
        padding: 10px;
        align-items: flex-start;
    }
    
    .modal {
        min-height: auto;
    }
    
    .modal-content {
        flex-direction: column;
        padding: 18px;
        gap: 14px;
        margin: 10px 0;
        max-height: calc(100vh - 20px);
        overflow-y: auto;
    }

    .modal-right {
        width: 100%;
        order: -1;
        padding: 16px;
        border-radius: 12px;
    }
    
    .modal-left {
        order: 1;
    }
    
    .modal-left h2 {
        font-size: var(--large);
        margin-bottom: 8px;
    }
    
    .modal-left p {
        font-size: var(--body);
        margin-bottom: 12px;
    }
    
    .modal-right h3 {
        font-size: var(--large);
        margin-bottom: 14px;
    }
    
    .contact-list {
        gap: 8px;
    }
    
    .contact-list li {
        padding: 10px 12px;
        border-radius: 8px;
    }
    
    .contact-list i {
        font-size: 18px;
        width: 36px;
        height: 36px;
    }
    
    .contact-label {
        font-size: var(--small);
    }
    
    .contact-value {
        font-size: var(--body);
    }
}

/* Tablet Portrait */
@media (max-width: 767px) and (min-width: 600px) {
    #form {
        padding: 8px;
        align-items: flex-start;
    }
    
    .modal {
        min-height: auto;
    }
    
    .modal-content {
        flex-direction: column;
        padding: 16px;
        gap: 12px;
        margin: 8px 0;
        border-radius: 10px;
        max-height: calc(100vh - 16px);
        overflow-y: auto;
    }
    
    .modal-right {
        order: -1;
        padding: 14px;
        border-radius: 10px;
    }
    
    .modal-left {
        order: 1;
    }
    
    .modal-left h2 {
        font-size: var(--large);
        margin-bottom: 8px;
        line-height: 1.2;
    }
    
    .modal-left p {
        margin-bottom: 12px;
        font-size: var(--body);
        line-height: 1.4;
    }
    
    .two-col {
        gap: 8px;
        margin-bottom: 8px;
    }
    
    input,
    textarea {
        padding: 10px 12px;
        font-size: var(--body);
        min-height: 42px;
        border-radius: 6px;
    }
    
    textarea {
        min-height: 70px;
        margin-bottom: 8px;
    }
    
    #telegram-teams-id {
        margin-bottom: 8px;
    }
    
    .btn-primary,
    .btn-outline {
        padding: 10px 0;
        font-size: var(--body);
        min-height: 42px;
        border-radius: 6px;
    }
    
    .form-actions {
        gap: 8px;
        margin-top: 3px;
    }
    
    .modal-right h3 {
        font-size: var(--large);
        margin-bottom: 12px;
    }
    
    .contact-list {
        gap: 8px;
    }
    
    .contact-list li {
        padding: 10px 12px;
        border-radius: 8px;
    }
    
    /* Hide icons on portrait devices */
    .contact-list i {
        display: none;
    }
    
    .contact-info {
        gap: 2px;
    }
    
    .contact-label {
        font-size: var(--small);
        margin-bottom: 2px;
    }
    
    .contact-value {
        font-size: var(--body);
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* Large Mobile */
@media (max-width: 599px) and (min-width: 480px) {
    #form {
        padding: 6px;
        align-items: flex-start;
    }
    
    .modal-content {
        flex-direction: column;
        padding: 14px;
        gap: 10px;
        margin: 6px 0;
        border-radius: 8px;
        max-height: calc(100vh - 12px);
        overflow-y: auto;
    }
    
    .modal-right {
        order: -1;
        padding: 12px;
        border-radius: 8px;
    }
    
    .modal-left {
        order: 1;
    }
    
    .modal-left h2 {
        font-size: var(--large);
        margin-bottom: 6px;
        line-height: 1.2;
    }
    
    .modal-left p {
        margin-bottom: 10px;
        font-size: var(--body);
        line-height: 1.3;
    }
    
    .two-col {
        flex-direction: column;
        gap: 6px;
        margin-bottom: 6px;
    }
    
    input,
    textarea {
        padding: 8px 10px;
        font-size: var(--body);
        min-height: 40px;
        border-radius: 5px;
    }
    
    textarea {
        min-height: 60px;
        margin-bottom: 6px;
    }
    
    #telegram-teams-id {
        margin-bottom: 6px;
    }
    
    .btn-primary,
    .btn-outline {
        padding: 8px 0;
        font-size: var(--body);
        min-height: 40px;
        border-radius: 5px;
        font-weight: 600;
    }
    
    .form-actions {
        gap: 6px;
        margin-top: 2px;
    }
    
    .modal-right h3 {
        font-size: var(--body);
        margin-bottom: 10px;
    }
    
    .modal-right h3::after {
        width: 30px;
        height: 2px;
    }
    
    .contact-list {
        gap: 6px;
    }
    
    .contact-list li {
        padding: 8px 10px;
        border-radius: 6px;
    }
    
    /* Hide icons on mobile devices */
    .contact-list i {
        display: none;
    }
    
    .contact-info {
        gap: 1px;
    }
    
    .contact-label {
        font-size: var(--small);
        margin-bottom: 1px;
    }
    
    .contact-value {
        font-size: var(--body);
        line-height: 1.2;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
}

/* Medium Mobile */
@media (max-width: 479px) and (min-width: 375px) {
    #form {
        padding: 8px;
        align-items: flex-start;
    }
    
    .modal-content {
        flex-direction: column;
        padding: 18px;
        gap: 14px;
        margin: 8px 0;
        border-radius: 8px;
        max-height: calc(100vh - 16px);
        overflow-y: auto;
    }
    
    .modal-right {
        order: -1;
        padding: 16px;
        border-radius: 8px;
    }
    
    .modal-left {
        order: 1;
    }
    
    .modal-left h2 {
        font-size: var(--large);
        margin-bottom: 8px;
        line-height: 1.3;
    }
    
    .modal-left p {
        margin-bottom: 12px;
        font-size: var(--body);
        line-height: 1.4;
    }
    
    .two-col {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 8px;
    }
    
    input,
    textarea {
        padding: 10px 12px;
        font-size: var(--body);
        min-height: 42px;
        border-radius: 6px;
    }
    
    textarea {
        min-height: 70px;
        margin-bottom: 8px;
    }
    
    #telegram-teams-id {
        margin-bottom: 8px;
    }
    
    .btn-primary,
    .btn-outline {
        padding: 10px 0;
        font-size: var(--body);
        min-height: 42px;
        border-radius: 6px;
        font-weight: 600;
    }
    
    .form-actions {
        gap: 10px;
        margin-top: 6px;
    }
    
    .modal-right h3 {
        font-size: var(--body);
        margin-bottom: 12px;
    }
    
    .modal-right h3::after {
        width: 30px;
        height: 3px;
    }
    
    .contact-list {
        gap: 8px;
    }
    
    .contact-list li {
        padding: 10px 12px;
        border-radius: 6px;
    }
    
    /* Hide icons on small mobile devices */
    .contact-list i {
        display: none;
    }
    
    .contact-info {
        gap: 3px;
    }
    
    .contact-label {
        font-size: var(--small);
        margin-bottom: 2px;
    }
    
    .contact-value {
        font-size: var(--small);
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
}

/* Small Mobile */
@media (max-width: 374px) {
    #form {
        padding: 6px;
        align-items: flex-start;
    }
    
    .modal-content {
        flex-direction: column;
        padding: 14px;
        gap: 10px;
        margin: 6px 0;
        border-radius: 6px;
        max-height: calc(100vh - 12px);
        overflow-y: auto;
    }
    
    .modal-right {
        order: -1;
        padding: 12px;
        border-radius: 6px;
    }
    
    .modal-left {
        order: 1;
    }

    .modal-left h2 {
        font-size: var(--body);
        margin-bottom: 6px;
        line-height: 1.2;
    }
    
    .modal-left p {
        margin-bottom: 10px;
        font-size: var(--body);
        line-height: 1.3;
    }

    .two-col {
        flex-direction: column;
        gap: 6px;
        margin-bottom: 6px;
    }
    
    input,
    textarea {
        padding: 8px 10px;
        font-size: var(--body);
        min-height: 38px;
        border-radius: 5px;
    }
    
    textarea {
        min-height: 60px;
        margin-bottom: 6px;
    }
    
    #telegram-teams-id {
        margin-bottom: 6px;
    }
    
    .btn-primary,
    .btn-outline {
        padding: 8px 0;
        font-size: var(--body);
        min-height: 38px;
        border-radius: 5px;
        font-weight: 600;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 8px;
        margin-top: 4px;
    }
    
    .modal-right h3 {
        font-size: var(--body);
        margin-bottom: 10px;
    }
    
    .modal-right h3::after {
        width: 25px;
        height: 2px;
    }
    
    .contact-list {
        gap: 6px;
    }
    
    .contact-list li {
        padding: 8px 10px;
        border-radius: 5px;
    }
    
    /* Hide icons on very small mobile devices */
    .contact-list i {
        display: none;
    }
    
    .contact-info {
        gap: 2px;
    }
    
    .contact-label {
        font-size: var(--small);
        margin-bottom: 1px;
    }
    
    .contact-value {
        font-size: var(--small);
        line-height: 1.2;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
}

/* Enhanced touch targets for all mobile devices */
@media (max-width: 767px) {
  .btn-primary,
  .btn-outline {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  input,
  textarea {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .contact-list li {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  /* Error states for mobile */
  input.error,
  textarea.error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
  }

  input.error:focus,
  textarea.error:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
  }

  /* Responsive Toast for Mobile */
  .success-toast {
    top: 16px;
    right: 16px;
    left: 16px;
    max-width: none;
    min-width: 0;
    padding: 14px 16px;
    gap: 10px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12), 0 4px 6px rgba(0, 0, 0, 0.06);
  }

  .toast-content h4 {
    font-size: var(--small);
  }

  .toast-content p {
    font-size: var(--small);
    line-height: 1.4;
  }

  .toast-icon i {
    font-size: 20px;
  }

  .toast-close {
    width: 18px;
    height: 18px;
  }

  .toast-close i {
    font-size: 14px;
  }
}

/* Landscape phone optimization */
@media (max-width: 896px) and (max-height: 500px) and (orientation: landscape) {
  #form {
    align-items: flex-start;
    padding: 8px;
  }

  .modal {
    min-height: auto;
  }

  .modal-content {
    flex-direction: row;
    max-height: calc(100vh - 16px);
    overflow-y: auto;
    margin: 8px 0;
    padding: 16px;
    gap: 16px;
  }

  .modal-right {
    order: 0;
    flex: 0 0 35%;
    padding: 14px;
    overflow-y: auto;
  }

  .modal-left {
    order: 1;
    flex: 1;
    overflow-y: auto;
  }

  .modal-left h2 {
    font-size: var(--large);
    margin-bottom: 6px;
  }

  .modal-left p {
    font-size: var(--body);
    margin-bottom: 8px;
  }

  .modal-right h3 {
    font-size: var(--body);
    margin-bottom: 8px;
  }

  .contact-list {
    gap: 6px;
  }

      .contact-list li {
        padding: 6px 8px;
        font-size: var(--small);
    }
    
    /* Hide icons in landscape mode */
    .contact-list i {
        display: none;
    }
    
    .contact-info {
        gap: 2px;
    }
    
    .contact-label {
        font-size: var(--small);
        margin-bottom: 1px;
    }
    
    .contact-value {
        font-size: var(--small);
        line-height: 1.2;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

  input,
  textarea {
    padding: 8px 10px;
    font-size: var(--small);
    min-height: 36px;
  }

  textarea {
    min-height: 50px;
    margin-bottom: 6px;
  }

  #telegram-teams-id {
    margin-bottom: 6px;
  }

  .two-col {
    gap: 6px;
    margin-bottom: 6px;
  }

  .btn-primary,
  .btn-outline {
    padding: 8px 0;
    font-size: var(--small);
    min-height: 36px;
  }

  .form-actions {
    gap: 8px;
    margin-top: 4px;
  }

  /* Toast for Landscape Mobile */
  .success-toast {
    top: 10px;
    right: 10px;
    max-width: 300px;
    min-width: 250px;
    padding: 10px 12px;
    gap: 6px;
    border-radius: 6px;
  }

  .toast-content h4 {
    font-size: var(--small);
    margin-bottom: 1px;
  }

  .toast-content p {
    font-size: var(--small);
    line-height: 1.2;
  }
}
